Skip to content

Commit

Permalink
fix: use node available in node status (#762)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Mar 1, 2021
1 parent 3757d0e commit d4972e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,11 @@ function onNodeStatus (node) {
let data

if (this.config.payloadType === 2) {
data = node.ready
data = node.available
} else {
data = {
time: Date.now(),
value: node.ready,
value: node.available,
status: node.status,
nodeId: node.id
}
Expand Down
1 change: 1 addition & 0 deletions lib/ZwaveClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ function onNodeStatus (zwaveNode) {
if (node) {
// https://github.com/zwave-js/node-zwave-js/blob/master/packages/zwave-js/src/lib/node/Types.ts#L127
node.status = NodeStatus[zwaveNode.status]
node.available = zwaveNode.status !== NodeStatus.Dead
node.interviewStage = InterviewStage[zwaveNode.interviewStage]
this.emit('nodeStatus', node)
} else {
Expand Down
1 change: 1 addition & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export type Z2MNode = {
values: Map<string, Z2MValueId>
groups: Z2MNodeGroups[]
ready: boolean
available: boolean
failed: boolean
lastActive: number
dbLink: string
Expand Down

0 comments on commit d4972e8

Please sign in to comment.