Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Commit

Permalink
Removed NIF on scan complete and added event nodeAvailable
Browse files Browse the repository at this point in the history
to debug issue #11
  • Loading branch information
robertsLando committed Mar 12, 2019
1 parent 32eaf5e commit bdc29ec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/ZwaveClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const EVENTS = {
'node added': nodeAdded,
'node removed': nodeRemoved,
//'node reset': nop,
//'node available': nop,
'node available': nodeAvailable,
'node ready': nodeReady,
//'node naming': nop,
'node event': nodeEvent,
Expand Down Expand Up @@ -268,6 +268,10 @@ function valueRemoved(nodeid, comclass, instance, index) {
}
}

function nodeAvailable(nodeid, nodeinfo){
debug("Node ID %d is available", nodeid, nodeinfo)
}

function nodeReady(nodeid, nodeinfo) {
var ozwnode = this.nodes[nodeid];
if (ozwnode) {
Expand Down Expand Up @@ -378,10 +382,6 @@ function valueRemoved(nodeid, comclass, instance, index) {
//popolate groups (just for active nodes)
for (var i = 0; i < nodes.length; i++) {
this.getGroups(nodes[i].node_id);
//try to send a NIF to update state of sleeping battery power devices
if(!nodes[i].ready){
this.client.sendNodeInformation(nodes[i].node_id)
}
}

debug('Network scan complete. Found:', nodes.length, 'nodes');
Expand Down

0 comments on commit bdc29ec

Please sign in to comment.