Skip to content

Commit

Permalink
fix: set driver ready to false immediatly on driver error
Browse files Browse the repository at this point in the history
Ref #3647
  • Loading branch information
robertsLando committed Mar 27, 2024
1 parent f6dff21 commit 9693ba5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,10 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
}

public set driverReady(ready) {
this._driverReady = ready
this.emit('driverStatus', ready)
if (this._driverReady !== ready) {
this._driverReady = ready
this.emit('driverStatus', ready)
}
}

public get cntStatus() {
Expand Down Expand Up @@ -4380,6 +4382,7 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {

if (!skipRestart && error.code === ZWaveErrorCodes.Driver_Failed) {
// this cannot be recovered by zwave-js, requires a manual restart
this.driverReady = false
this.backoffRestart()
}
}
Expand Down

0 comments on commit 9693ba5

Please sign in to comment.