Skip to content

Commit

Permalink
fix: firmware update, data is not a buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Nov 25, 2020
1 parent d3c8531 commit bba0f06
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 5 additions & 3 deletions lib/ZwaveClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -1672,8 +1672,7 @@ function guessFirmwareFormat (filename, firmware) {
ZwaveClient.prototype.beginFirmwareUpdate = async function (
nodeId,
fileName,
data,
target = 0
data
) {
if (this.driver && !this.closed) {
const zwaveNode = this.getNode(nodeId)
Expand All @@ -1694,7 +1693,10 @@ ZwaveClient.prototype.beginFirmwareUpdate = async function (
throw Error('Unable to extract firmware from file: ' + e.message)
}

return zwaveNode.beginFirmwareUpdate(actualFirmware, target)
return zwaveNode.beginFirmwareUpdate(
actualFirmware.data,
actualFirmware.firmwareTarget
)
}

throw Error('Driver is closed')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,4 @@
"last 2 versions",
"not ie <= 8"
]
}
}
5 changes: 4 additions & 1 deletion src/components/ControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,10 @@ export default {
var askId = this.node_actions.find(a => a.value === this.cnt_action)
if (askId) {
// don't send replaceFailed as broadcast
if (this.cnt_action !== 'replaceFailedNode') {
if (
this.cnt_action !== 'replaceFailedNode' &&
this.cnt_action !== 'beginFirmwareUpdate'
) {
broadcast = await this.$listeners.showConfirm(
'Broadcast',
'Send this command to all nodes?'
Expand Down

0 comments on commit bba0f06

Please sign in to comment.