Skip to content

Commit

Permalink
fix: add controller status changes to controller events (#3932)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Oct 8, 2024
1 parent 75ad9e9 commit 3f95e30
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions api/lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ export type ZUINode = {
}

export type NodeEvent = {
event: ZwaveNodeEvents
event: ZwaveNodeEvents | 'status changed'
args: any[]
time: Date
}
Expand Down Expand Up @@ -4588,6 +4588,11 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
}

this._updateControllerStatus(message)
this._onNodeEvent(
'status changed',
this.getNode(this.driver.controller.ownNodeId),
status,
)
this.emit('event', EventSource.CONTROLLER, 'status changed', status)
}

Expand Down Expand Up @@ -5127,7 +5132,7 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
*
*/
private _onNodeEvent(
eventName: ZwaveNodeEvents,
eventName: ZwaveNodeEvents | 'status changed',
zwaveNode: ZWaveNode,
...eventArgs: any[]
) {
Expand Down

0 comments on commit 3f95e30

Please sign in to comment.