Skip to content

Commit

Permalink
fix: save value change options on ZWaveNode instance (#4009)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone authored Nov 14, 2024
1 parent b0ade31 commit 75981c1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2553,13 +2553,15 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
props: Pick<ZUINode, 'defaultTransitionDuration' | 'defaultVolume'>,
) {
const node = this._nodes.get(nodeId)
const zwaveNode = this.getNode(nodeId)

if (!node) {
if (!zwaveNode) {
throw Error('Invalid Node ID')
}

for (const k in props) {
node[k] = props[k]
zwaveNode[k] = props[k]
if (node) node[k] = props[k]
}
}

Expand Down

0 comments on commit 75981c1

Please sign in to comment.