Skip to content

Commit

Permalink
fix: discover values after node ready
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Dec 1, 2020
1 parent a6f05c5 commit dd1fe56
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/Gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@ function onValueChanged (valueId, node, changed) {
this.zwave.sendToSocket(this.zwave.socketEvents.valueUpdated, valueId)
}

const isDiscovered = this.discovered[valueId.id]

// check if this value isn't discovered yet (values added after node is ready)
if (this.config.hassDiscovery && !isDiscovered) {
this.discoverValue(node, valueId.id.replace(valueId.nodeId + '-', ''))
}

const result = this.valueTopic(node, valueId, true)

if (!result) return
Expand Down

0 comments on commit dd1fe56

Please sign in to comment.