diff --git a/lib/ZwaveClient.js b/lib/ZwaveClient.js index 69e6cc6080b..8b876e1125c 100644 --- a/lib/ZwaveClient.js +++ b/lib/ZwaveClient.js @@ -165,7 +165,7 @@ function driverReady () { .on('node added', onNodeAdded.bind(this)) .on('node removed', onNodeRemoved.bind(this)) .on('heal network progress', onHealNetworkProgress.bind(this)) - // .on('heal network done', onHealNetworkDone.bind(this)) + .on('heal network done', onHealNetworkDone.bind(this)) for (const [, node] of this.driver.controller.nodes) { // node added will not be triggered if the node is in cache @@ -310,24 +310,17 @@ function onNodeRemoved (zwaveNode) { function onHealNetworkProgress (progress) { const toHeal = [...progress.values()] const healedNodes = toHeal.filter(v => v !== 'pending') - let message - // If this is the final progress report, skip it, so the frontend gets the "done" message - if (healedNodes.length === toHeal.length) { - message = `Healing process COMPLETED. Healed ${toHeal.length} nodes` - } else { - message = `Healing process IN PROGRESS. Healed ${healedNodes.length} nodes` - } + const message = `Healing process IN PROGRESS. Healed ${healedNodes.length} nodes` + updateControllerStatus.call(this, message) this.emit('event', eventEmitter.controller, 'heal network progress', progress) +} +function onHealNetworkDone (result) { + const message = `Healing process COMPLETED. Healed ${result.size} nodes` updateControllerStatus.call(this, message) } -// function onHealNetworkDone (result) { -// var message = `Healing process COMPLETED. Healed ${result.length} nodes` -// updateControllerStatus.call(this, message) -// } - // ---------- NODE EVENTS ------------------------------------- /**