Skip to content

Commit

Permalink
feat: Add status string to node status and lastUpdate value on zwave …
Browse files Browse the repository at this point in the history
…valueId object #260
  • Loading branch information
robertsLando committed Feb 19, 2020
1 parent 278a48e commit 648da43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ function onNodeSceneEvent (event, node, code) {
function onValueChanged (valueId, node, changed) {
var data, topic, valueConf

valueId.lastUpdate = Date.now()

// emit event to socket
if (this.zwave) this.zwave.emitEvent('VALUE_UPDATED', valueId)

Expand Down Expand Up @@ -278,7 +280,7 @@ function onNodeStatus (node) {
if (this.config.payloadType === 2) {
data = node.ready
} else {
data = { time: Date.now(), value: node.ready }
data = { time: Date.now(), value: node.ready, status: node.status }
}

this.mqtt.publish(topic, data)
Expand Down

0 comments on commit 648da43

Please sign in to comment.