set pi gpio pin status correctly if set on start

This commit is contained in:
Dave Conway-Jones 2016-05-26 10:37:20 +01:00
parent 8d4be848b0
commit 807873f685
1 changed files with 2 additions and 1 deletions

View File

@ -160,11 +160,12 @@ module.exports = function(RED) {
if (node.pin !== undefined) {
if (node.set && (node.out === "out")) {
node.child = spawn(gpioCommand, [node.out,node.pin,node.level]);
node.status({fill:"green",shape:"dot",text:node.level});
} else {
node.child = spawn(gpioCommand, [node.out,node.pin]);
node.status({fill:"green",shape:"dot",text:"common.status.ok"});
}
node.running = true;
node.status({fill:"green",shape:"dot",text:"common.status.ok"});
node.on("input", inputlistener);