Skip to content

Commit

Permalink
fix: duplicate nodestatus call in initNode
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Dec 1, 2020
1 parent 720a9c0 commit a8a984b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 1 addition & 3 deletions lib/ZwaveClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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])

Expand Down

0 comments on commit a8a984b

Please sign in to comment.