Skip to content

Commit

Permalink
feat: listen for node info received event (#3954)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Oct 17, 2024
1 parent 99f7b9a commit 8f873a2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api/lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5732,6 +5732,17 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
)
}

private _onNodeInfoReceived(zwaveNode: ZWaveNode) {
this.logNode(zwaveNode, 'info', `Node info (NIF) received`)

this.emit(
'event',
EventSource.NODE,
'node info received',
this.zwaveNodeToJSON(zwaveNode),
)
}

/**
* Emitted when we receive a node `firmware update progress` event
*
Expand Down Expand Up @@ -5850,6 +5861,7 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
this._onNodeFirmwareUpdateFinished.bind(this),
)
.on('statistics updated', this._onNodeStatisticsUpdated.bind(this))
.on('node info received', this._onNodeInfoReceived.bind(this))

const events: ZwaveNodeEvents[] = [
'ready',
Expand Down

0 comments on commit 8f873a2

Please sign in to comment.