Skip to content

Commit

Permalink
some notifications should be transient, others (eg controller command…
Browse files Browse the repository at this point in the history
…s) should not
  • Loading branch information
ekarak committed Jan 14, 2017
1 parent 990db59 commit 04c145a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions 10-zwave.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ module.exports = function(RED) {
nrNodes[nrnid].call(nrNode, event, arghash);
// update the node status accordingly
var status = {fill: "yellow", text: event, shape: "ring"};
var transient = true;
switch(event) {
case 'node event':
case 'node ready':
Expand All @@ -109,16 +110,20 @@ module.exports = function(RED) {
case 'value changed':
status.text = util.format('node %j: %s', arghash.nodeid, event);
break;
case 'controller command': //, function(nodeId, ctrlState, ctrlError, helpmsg)
status.text = util.format('%j', arghash.helpmsg);
case 'notification':
case 'controller command':
transient = false;
status.text = util.format('%s', arghash.help);
break;
default:
break;
}
updateNodeRedStatus(nrNode, status);
setTimeout(function() {
updateNodeRedStatus(nrNode);
}, 500);
if (transient) {
setTimeout(function() {
updateNodeRedStatus(nrNode);
}, 500);
}
}
}
}
Expand Down

0 comments on commit 04c145a

Please sign in to comment.