Skip to content

Commit

Permalink
fix: reset node fw update progress on abort (#2692)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Sep 27, 2022
1 parent 205eaeb commit 08ed7cb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2304,7 +2304,19 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
throw Error(`Node ${nodeId} not found`)
}

return zwaveNode.abortFirmwareUpdate()
await zwaveNode.abortFirmwareUpdate()

const node = this._nodes.get(nodeId)

// reset fw update progress
if (node) {
node.firmwareUpdate = undefined

this.sendToSocket(socketEvents.nodeUpdated, {
id: node?.id,
firmwareUpdate: false,
})
}
}

throw new DriverNotReadyError()
Expand Down

0 comments on commit 08ed7cb

Please sign in to comment.