Skip to content

Commit

Permalink
fix: ignoreUpdates on getGroups when initing node
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Dec 1, 2020
1 parent fe08a27 commit 64c78ea
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/ZwaveClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ function initNode (zwaveNode) {
node.productId
)}-${utils.num2hex(node.productType)}`

this.getGroups(zwaveNode.id)
this.getGroups(zwaveNode.id, true)
}

function updateValueMetadata (zwaveNode, zwaveValue, zwaveValueMeta) {
Expand Down Expand Up @@ -1094,7 +1094,10 @@ ZwaveClient.prototype.addEmptyNodes = function () {
*
* @param {Integer} nodeId Zwave node id
*/
ZwaveClient.prototype.getGroups = async function (nodeId) {
ZwaveClient.prototype.getGroups = async function (
nodeId,
ignoreUpdate = false
) {
const zwaveNode = this.getNode(nodeId)
if (zwaveNode) {
let groups = []
Expand All @@ -1116,7 +1119,9 @@ ZwaveClient.prototype.getGroups = async function (nodeId) {
}
}

onNodeStatus.call(this, zwaveNode)
if (!ignoreUpdate) {
onNodeStatus.call(this, zwaveNode)
}
}

/**
Expand Down

0 comments on commit 64c78ea

Please sign in to comment.