Skip to content

Commit

Permalink
feat: add support for EU Long Range (#6751)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone authored Aug 30, 2024
1 parent 7c36887 commit b631dd5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/capabilities/RFRegion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ export enum RFRegion {
"USA" = 0x01,
"Australia/New Zealand" = 0x02,
"Hong Kong" = 0x03,
// 0x04 is deprecated
"India" = 0x05,
"Israel" = 0x06,
"Russia" = 0x07,
"China" = 0x08,
"USA (Long Range)" = 0x09,
// 0x0a is deprecated
"Europe (Long Range)" = 0x0b,
"Japan" = 0x20,
"Korea" = 0x21,
"Unknown" = 0xfe,
Expand All @@ -32,6 +35,7 @@ export enum ZnifferRegion {
"China" = 0x08,
"USA (Long Range)" = 0x09,
"USA (Long Range, backup)" = 0x0a,
"Europe (Long Range)" = 0x0b,
"Japan" = 0x20,
"Korea" = 0x21,
"USA (Long Range, end device)" = 0x30,
Expand Down
16 changes: 14 additions & 2 deletions packages/zwave-js/src/lib/controller/Controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import {
dskFromString,
dskToString,
encodeX25519KeyDERSPKI,
getChipTypeAndVersion,
indexDBsByNode,
isEmptyRoute,
isLongRangeNodeId,
Expand Down Expand Up @@ -6453,9 +6454,20 @@ ${associatedNodes.join(", ")}`,
]);

if (this.isLongRangeCapable()) {
// All LR capable controllers support USA Long Range
ret.add(RFRegion["USA (Long Range)"]);
if (filterSubsets) {
ret.delete(RFRegion.USA);
if (filterSubsets) ret.delete(RFRegion.USA);

// EU Long Range was added in SDK 7.22 for 800 series chips
// 7.22.1 adds support for querying the supported regions, so the following
// is really only necessary for 7.22.0.
if (
typeof this._zwaveChipType === "string"
&& getChipTypeAndVersion(this._zwaveChipType)?.type === 8
&& this.sdkVersionGte("7.22")
) {
ret.add(RFRegion["Europe (Long Range)"]);
if (filterSubsets) ret.delete(RFRegion.Europe);
}
}

Expand Down

0 comments on commit b631dd5

Please sign in to comment.