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: add support for EU Long Range #6751

Merged
merged 4 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading