mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-05-13 22:06:55 +02:00
update node-red
This commit is contained in:
parent
f8a2ad006e
commit
a04f905a70
@ -10,6 +10,7 @@ RUN set -xe \
|
|||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl \
|
curl \
|
||||||
nodejs \
|
nodejs \
|
||||||
|
nodejs-npm \
|
||||||
python3 \
|
python3 \
|
||||||
python3-dev \
|
python3-dev \
|
||||||
&& ln -sf /usr/bin/python3 /usr/bin/python \
|
&& ln -sf /usr/bin/python3 /usr/bin/python \
|
||||||
|
@ -10,6 +10,7 @@ RUN set -xe \
|
|||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl \
|
curl \
|
||||||
nodejs \
|
nodejs \
|
||||||
|
nodejs-npm \
|
||||||
python3 \
|
python3 \
|
||||||
python3-dev \
|
python3-dev \
|
||||||
&& ln -sf /usr/bin/python3 /usr/bin/python \
|
&& ln -sf /usr/bin/python3 /usr/bin/python \
|
||||||
|
@ -84,6 +84,7 @@ module.exports = function(RED) {
|
|||||||
node.child.stdout.on('data', function (data) {
|
node.child.stdout.on('data', function (data) {
|
||||||
var d = data.toString().trim().split("\n");
|
var d = data.toString().trim().split("\n");
|
||||||
for (var i = 0; i < d.length; i++) {
|
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]) {
|
if (node.running && node.buttonState !== -1 && !isNaN(Number(d[i])) && node.buttonState !== d[i]) {
|
||||||
node.send({ topic:"pi/"+node.pin, payload:Number(d[i]) });
|
node.send({ topic:"pi/"+node.pin, payload:Number(d[i]) });
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user