1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

Update LEDborg node to set status more correctly on error

This commit is contained in:
Dave Conway-Jones 2016-01-01 14:35:54 +00:00
parent 9e9a5e21be
commit c2dc764965
2 changed files with 9 additions and 4 deletions

View File

@ -97,10 +97,15 @@ module.exports = function(RED) {
} }
if (RED.settings.verbose) { node.log("out: "+msg.payload); } if (RED.settings.verbose) { node.log("out: "+msg.payload); }
if (node.child !== null) { node.child.stdin.write(rgb+"\n"); } if (node.child !== null) {
else { node.warn("Command not running"); } node.child.stdin.write(rgb+"\n");
node.status({fill:"green",shape:"dot",text:msg.payload}); node.status({fill:"green",shape:"dot",text:msg.payload});
} }
else {
node.warn("Command not running");
node.status({fill:"red",shape:"ring",text:"Command not running"});
}
}
node.child = spawn(gpioCommand, ["borg","11"]); node.child = spawn(gpioCommand, ["borg","11"]);
node.running = true; node.running = true;

View File

@ -1,6 +1,6 @@
{ {
"name" : "node-red-node-ledborg", "name" : "node-red-node-ledborg",
"version" : "0.0.12", "version" : "0.0.13",
"description" : "A Node-RED node to control a PiBorg LedBorg board for a Raspberry Pi.", "description" : "A Node-RED node to control a PiBorg LedBorg board for a Raspberry Pi.",
"dependencies" : { "dependencies" : {
}, },