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

stop gpis node reporting bad status message on slow Pi

This commit is contained in:
Dave Conway-Jones 2017-07-02 00:50:55 +01:00
parent 9639081e7e
commit 304be96dd6
No known key found for this signature in database
GPG Key ID: 81B04231572A9A2D

View File

@ -69,6 +69,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]) });
}