From 5cc3aed5dc886a8b5de976d29db1aabbc736630b Mon Sep 17 00:00:00 2001 From: AlCalzone Date: Thu, 12 Oct 2023 19:37:38 +0200 Subject: [PATCH] fix: expose the correct firmware update capabilities to applications (#6396) --- packages/zwave-js/src/lib/node/Node.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/zwave-js/src/lib/node/Node.ts b/packages/zwave-js/src/lib/node/Node.ts index d8968b49409d..ab41e26f5aa1 100644 --- a/packages/zwave-js/src/lib/node/Node.ts +++ b/packages/zwave-js/src/lib/node/Node.ts @@ -4657,8 +4657,6 @@ protocol version: ${this.protocolVersion}`; // Ensure all information was queried if ( !firmwareUpgradable - || supportsActivation == undefined - || continuesToFunction == undefined || !isArray(additionalFirmwareIDs) ) { return { firmwareUpgradable: false }; @@ -4666,7 +4664,9 @@ protocol version: ${this.protocolVersion}`; return { firmwareUpgradable: true, - firmwareTargets: distinct([0, ...additionalFirmwareIDs]), + // TODO: Targets are not the list of IDs - maybe expose the IDs as well? + firmwareTargets: new Array(1 + additionalFirmwareIDs.length).fill(0) + .map((_, i) => i), continuesToFunction, supportsActivation, }; @@ -4694,7 +4694,9 @@ protocol version: ${this.protocolVersion}`; return { firmwareUpgradable: true, - firmwareTargets: [0, ...meta.additionalFirmwareIDs], + // TODO: Targets are not the list of IDs - maybe expose the IDs as well? + firmwareTargets: new Array(1 + meta.additionalFirmwareIDs.length) + .fill(0).map((_, i) => i), continuesToFunction: meta.continuesToFunction, supportsActivation: meta.supportsActivation, };