From a8a984b4b13079da65bb16762214ee4f7d72e7ae Mon Sep 17 00:00:00 2001 From: Daniel Lando Date: Tue, 1 Dec 2020 14:34:27 +0100 Subject: [PATCH] fix: duplicate nodestatus call in initNode --- lib/Gateway.js | 2 +- lib/ZwaveClient.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Gateway.js b/lib/Gateway.js index e06b73183bb..924f9f306cf 100755 --- a/lib/Gateway.js +++ b/lib/Gateway.js @@ -1155,7 +1155,7 @@ Gateway.prototype.discoverDevice = function (node, hassDevice) { */ Gateway.prototype.discoverClimates = function (node) { // https://github.com/zwave-js/node-zwave-js/blob/master/packages/config/config/deviceClasses.json#L177 - if (!node.deviceClass.generic === 0x08) { + if (!node.deviceClass || node.deviceClass.generic !== 0x08) { // it's a thermostat return } diff --git a/lib/ZwaveClient.js b/lib/ZwaveClient.js index 31cd72d27e3..05a839b9bef 100644 --- a/lib/ZwaveClient.js +++ b/lib/ZwaveClient.js @@ -276,8 +276,6 @@ function onNodeReady (zwaveNode) { if (!node || node.ready) return node.ready = true - onNodeStatus.call(this, zwaveNode) - initNode.call(this, zwaveNode) const values = zwaveNode.getDefinedValueIDs() @@ -288,7 +286,7 @@ function onNodeReady (zwaveNode) { node.lastActive = Date.now() - this.emit('nodeStatus', node) + onNodeStatus.call(this, zwaveNode) this.emit('event', eventEmitter.node, 'node ready', this.nodes[zwaveNode.id])