Skip to content

Commit

Permalink
fix: add missing NVM convert progress callback
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Dec 30, 2021
1 parent 29803e9 commit b849be9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2698,10 +2698,17 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {

await this.driver.controller.restoreNVM(
data,
this._onConvertNVMProgress.bind(this),
this._onRestoreNVMProgress.bind(this)
)
}

private _onConvertNVMProgress(bytesRead: number, totalBytes: number) {
const progress = Math.round((bytesRead / totalBytes) * 100)

this._updateControllerStatus(`Convert NVM progress: ${progress}%`)
}

private _onRestoreNVMProgress(bytesRead: number, totalBytes: number) {
const progress = Math.round((bytesRead / totalBytes) * 100)

Expand Down

0 comments on commit b849be9

Please sign in to comment.