Skip to content

Commit

Permalink
fix: expose the correct firmware update capabilities to applications (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone authored Oct 12, 2023
1 parent fd28c7e commit 5cc3aed
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/zwave-js/src/lib/node/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4657,16 +4657,16 @@ protocol version: ${this.protocolVersion}`;
// Ensure all information was queried
if (
!firmwareUpgradable
|| supportsActivation == undefined
|| continuesToFunction == undefined
|| !isArray(additionalFirmwareIDs)
) {
return { firmwareUpgradable: false };
}

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,
};
Expand Down Expand Up @@ -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,
};
Expand Down

0 comments on commit 5cc3aed

Please sign in to comment.