2
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2025-12-24 06:28:23 +01:00

update node-red

This commit is contained in:
kev
2017-07-03 15:00:40 +08:00
parent f8a2ad006e
commit a04f905a70
3 changed files with 3 additions and 0 deletions

View File

@@ -84,6 +84,7 @@ module.exports = function(RED) {
node.child.stdout.on('data', function (data) {
var d = data.toString().trim().split("\n");
for (var i = 0; i < d.length; i++) {
if (d[i] === '') { return; }
if (node.running && node.buttonState !== -1 && !isNaN(Number(d[i])) && node.buttonState !== d[i]) {
node.send({ topic:"pi/"+node.pin, payload:Number(d[i]) });
}