Skip to content

Commit

Permalink
fix: do not allow to set Unknown and Default (EU) regions
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Jan 16, 2025
1 parent ca030dc commit a9c8e3a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
3 changes: 3 additions & 0 deletions api/lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6137,6 +6137,9 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
?.map((region) => ({
value: region,
text: getEnumMemberName(RFRegion, region),
disabled:
region === RFRegion.Unknown ||
region === RFRegion['Default (EU)'],
}))
.sort((a, b) => a.text.localeCompare(b.text)) ?? []
}
Expand Down
6 changes: 1 addition & 5 deletions src/components/nodes-table/NodeDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@
</template>
</v-text-field>
</v-col>
<v-col
v-if="node.RFRegion !== undefined"
cols="12"
style="max-width: 300px"
>
<v-col cols="12" style="max-width: 300px">
<v-select
label="RF Region"
:items="node.rfRegions"
Expand Down
11 changes: 6 additions & 5 deletions src/lib/items.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@ export const rfRegions = Object.keys(RFRegion)
.map((key) => ({
text: key,
value: RFRegion[key],
disabled:
RFRegion[key] === RFRegion.Unknown ||
RFRegion[key] === RFRegion['Default (EU)'],
}))
.filter(
(region) =>
region.value !== RFRegion.Unknown &&
region.value !== RFRegion['Default (EU)'],
)
.sort((a, b) => a.text.localeCompare(b.text))

export const znifferRegions = Object.keys(ZnifferRegion)
.filter((k) => isNaN(k))
.map((key) => ({
text: key,
value: ZnifferRegion[key],
disabled:
RFRegion[key] === RFRegion.Unknown ||
RFRegion[key] === RFRegion['Default (EU)'],
}))
.sort((a, b) => a.text.localeCompare(b.text))

Expand Down

0 comments on commit a9c8e3a

Please sign in to comment.