mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
add complete node support to gpio out node (#647)
This commit is contained in:
parent
4641d10beb
commit
67c3d251e4
@ -129,7 +129,7 @@ module.exports = function(RED) {
|
||||
}
|
||||
}
|
||||
|
||||
function inputlistener(msg) {
|
||||
function inputlistener(msg, send, done) {
|
||||
if (msg.payload === "true") { msg.payload = true; }
|
||||
if (msg.payload === "false") { msg.payload = false; }
|
||||
var out = Number(msg.payload);
|
||||
@ -138,7 +138,11 @@ module.exports = function(RED) {
|
||||
if ((out >= 0) && (out <= limit)) {
|
||||
if (RED.settings.verbose) { node.log("out: "+out); }
|
||||
if (node.child !== null) {
|
||||
node.child.stdin.write(out+"\n");
|
||||
node.child.stdin.write(out+"\n", () => {
|
||||
if (done) {
|
||||
done();
|
||||
}
|
||||
});
|
||||
node.status({fill:"green",shape:"dot",text:msg.payload.toString()});
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user