From aa136189e37c6d38c7c1319fd0d9e08ec4171d81 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Mon, 2 Oct 2023 16:45:35 -0400 Subject: [PATCH 1/3] fix: update type for FirmwareUpdateServiceResponse --- packages/zwave-js/src/lib/controller/_Types.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/zwave-js/src/lib/controller/_Types.ts b/packages/zwave-js/src/lib/controller/_Types.ts index b67cda4e34b9..de8bd8740946 100644 --- a/packages/zwave-js/src/lib/controller/_Types.ts +++ b/packages/zwave-js/src/lib/controller/_Types.ts @@ -30,7 +30,9 @@ export type FirmwareUpdateDeviceID = Expand< export interface FirmwareUpdateServiceResponse { version: string; changelog: string; - channel: "stable" | "beta"; + /** When using the V1 API, channel is not returned and should be assumed to be + * stable */ + channel?: "stable" | "beta"; files: FirmwareUpdateFileInfo[]; downgrade: boolean; normalizedVersion: string; From 303029b4b5dd13591cb7c3c4b40f0a7f61658cdb Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Mon, 2 Oct 2023 16:50:36 -0400 Subject: [PATCH 2/3] fix: comment --- packages/zwave-js/src/lib/controller/_Types.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/zwave-js/src/lib/controller/_Types.ts b/packages/zwave-js/src/lib/controller/_Types.ts index de8bd8740946..7e37f7b51aa0 100644 --- a/packages/zwave-js/src/lib/controller/_Types.ts +++ b/packages/zwave-js/src/lib/controller/_Types.ts @@ -30,8 +30,7 @@ export type FirmwareUpdateDeviceID = Expand< export interface FirmwareUpdateServiceResponse { version: string; changelog: string; - /** When using the V1 API, channel is not returned and should be assumed to be - * stable */ + /** When using the V1 API, channel is not returned and should be assumed to be stable */ channel?: "stable" | "beta"; files: FirmwareUpdateFileInfo[]; downgrade: boolean; From 1ab0d135bc7fffa3116839d5ae67dc3aa0846dd5 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:38:42 -0400 Subject: [PATCH 3/3] fix: normalize return for Controller.getAvailableFirmwareUpdates --- packages/zwave-js/src/lib/controller/FirmwareUpdateService.ts | 1 + packages/zwave-js/src/lib/controller/_Types.ts | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/zwave-js/src/lib/controller/FirmwareUpdateService.ts b/packages/zwave-js/src/lib/controller/FirmwareUpdateService.ts index 41afabf05477..f8ea1597955f 100644 --- a/packages/zwave-js/src/lib/controller/FirmwareUpdateService.ts +++ b/packages/zwave-js/src/lib/controller/FirmwareUpdateService.ts @@ -226,6 +226,7 @@ export async function getAvailableFirmwareUpdates( return result.map((update) => ({ device: deviceId, ...update, + channel: update.channel ?? "stable", })); } diff --git a/packages/zwave-js/src/lib/controller/_Types.ts b/packages/zwave-js/src/lib/controller/_Types.ts index 7e37f7b51aa0..b67cda4e34b9 100644 --- a/packages/zwave-js/src/lib/controller/_Types.ts +++ b/packages/zwave-js/src/lib/controller/_Types.ts @@ -30,8 +30,7 @@ export type FirmwareUpdateDeviceID = Expand< export interface FirmwareUpdateServiceResponse { version: string; changelog: string; - /** When using the V1 API, channel is not returned and should be assumed to be stable */ - channel?: "stable" | "beta"; + channel: "stable" | "beta"; files: FirmwareUpdateFileInfo[]; downgrade: boolean; normalizedVersion: string;