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

Added message output to discrete-out

This commit is contained in:
Maxwell Hadley 2014-02-26 21:18:42 +00:00
parent 430300fa04
commit e8df573ea3
2 changed files with 2 additions and 1 deletions

View File

@ -342,7 +342,7 @@ the Inverting property is not applied to this value.
name: { value:"" } name: { value:"" }
}, },
inputs:1, // set the number of inputs - only 0 or 1 inputs:1, // set the number of inputs - only 0 or 1
outputs:0, // set the number of outputs - 0 to n outputs:1, // set the number of outputs - 0 to n
icon: "arrow-out.png", // set the icon (held in public/icons) icon: "arrow-out.png", // set the icon (held in public/icons)
label: function() { // sets the default label contents label: function() { // sets the default label contents
return this.name || "discrete-out: " + this.pin; return this.name || "discrete-out: " + this.pin;

View File

@ -319,6 +319,7 @@ function DiscreteOutputNode(n) {
} }
} }
bonescript.digitalWrite(node.pin, newState ? 1 : 0); bonescript.digitalWrite(node.pin, newState ? 1 : 0);
node.send({ topic:node.topic, payload:newState });
node.currentState = newState; node.currentState = newState;
}; };