Skip to content

Commit

Permalink
feat: show supported controller rf regions (#3785)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Jun 25, 2024
1 parent f386c4f commit c7929e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 9 additions & 0 deletions api/lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ export type ZUINode = {
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,14 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {

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()?.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()?.map(⏎↹↹↹↹` with `⏎↹↹↹↹this.driver.controller⏎↹↹↹↹↹.getSupportedRFRegions()⏎↹↹↹↹↹?.map(`
(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 `↹`
})).sort((a, b) => a.text.localeCompare(b.text)) ?? []

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

0 comments on commit c7929e9

Please sign in to comment.