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: allow specifying RF region for OTA firmware updates if unknown #7369

Merged
merged 1 commit into from
Nov 5, 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
3 changes: 2 additions & 1 deletion packages/zwave-js/src/lib/controller/Controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8207,7 +8207,7 @@ export class ZWaveController
productType,
productId,
firmwareVersion,
rfRegion: this.rfRegion,
rfRegion: this.rfRegion ?? options?.rfRegion,
},
{
userAgent: this.driver.getUserAgentStringWithComponents(
Expand Down Expand Up @@ -8250,6 +8250,7 @@ export class ZWaveController
): Promise<void> {
if (
deviceId.rfRegion !== undefined
&& this.rfRegion !== NOT_KNOWN
&& deviceId.rfRegion !== this.rfRegion
) {
throw new ZWaveError(
Expand Down
10 changes: 10 additions & 0 deletions packages/zwave-js/src/lib/controller/_Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ export interface GetFirmwareUpdatesOptions {
additionalUserAgentComponents?: Record<string, string>;
/** Whether the returned firmware upgrades should include prereleases from the `"beta"` channel. Default: `false`. */
includePrereleases?: boolean;
/**
* Can be used to specify the RF region if the Z-Wave controller
* does not support querying this information.
*
* **WARNING:** Specifying the wrong region may result in bricking the device!
*
* For this reason, the specified value is only used as a fallback
* if the RF region of the controller is not already known.
*/
rfRegion?: RFRegion;
}

export interface ControllerFirmwareUpdateProgress {
Expand Down
Loading