Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show supported controller rf regions #3785

Merged
merged 2 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions api/lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@
powerlevel?: number
measured0dBm?: number
RFRegion?: RFRegion
rfRegions?: { text: string, value: number }[]

Check failure on line 525 in api/lib/ZwaveClient.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Replace `,` with `;`
isFrequentListening?: FLiRS
isRouting?: boolean
keepAwake?: boolean
Expand Down Expand Up @@ -6029,6 +6030,15 @@

node.deviceId = this._getDeviceID(node)
node.hasDeviceConfigChanged = zwaveNode.hasDeviceConfigChanged()

if(node.isControllerNode) {

Check failure on line 6034 in api/lib/ZwaveClient.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Insert `·`
node.rfRegions = this.driver.controller.getSupportedRFRegions()?.toSorted().map(

Check failure on line 6035 in api/lib/ZwaveClient.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Replace `·this.driver.controller.getSupportedRFRegions()?.toSorted().map(⏎↹↹↹↹` with `⏎↹↹↹↹this.driver.controller⏎↹↹↹↹↹.getSupportedRFRegions()⏎↹↹↹↹↹?.toSorted()⏎↹↹↹↹↹.map(`
robertsLando marked this conversation as resolved.
Show resolved Hide resolved
(region) => ({
value: region,

Check failure on line 6037 in api/lib/ZwaveClient.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Insert `↹`
text: getEnumMemberName(RFRegion, region),

Check failure on line 6038 in api/lib/ZwaveClient.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Insert `↹`
}),

Check failure on line 6039 in api/lib/ZwaveClient.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Replace `}),⏎↹↹↹` with `↹})`
) ?? []
}
}

async updateControllerNodeProps(
Expand Down
4 changes: 1 addition & 3 deletions src/components/nodes-table/NodeDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
>
<v-select
label="RF Region"
:items="rfRegions"
:items="node.rfRegions"
v-model="node.RFRegion"
>
<template v-slot:append-outer>
Expand Down Expand Up @@ -346,7 +346,6 @@
<script>
import { mapState, mapActions } from 'pinia'
import { validTopic } from '../../lib/utils'
import { rfRegions } from '../../lib/items'
import { ConfigValueFormat } from '@zwave-js/core/safe'
import useBaseStore from '../../stores/base.js'
import InstancesMixin from '../../mixins/InstancesMixin.js'
Expand Down Expand Up @@ -384,7 +383,6 @@ export default {
parameter: 1,
valueFormat: ConfigValueFormat.UnsignedInteger,
},
rfRegions,
}
},
computed: {
Expand Down
Loading