mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Re-lint a load of nodes
This commit is contained in:
@@ -16,31 +16,37 @@ module.exports = function(RED) {
|
||||
var g = node.x.read();
|
||||
var msg = { payload:g, topic:node.board+"/D"+node.pin };
|
||||
switch (g) {
|
||||
case 0:
|
||||
case 0: {
|
||||
node.status({fill:"green",shape:"ring",text:"low"});
|
||||
if (node.interrupt=== "f" || node.interrupt === "b") {
|
||||
node.send(msg);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
}
|
||||
case 1: {
|
||||
node.status({fill:"green",shape:"dot",text:"high"});
|
||||
if (node.interrupt=== "r" || node.interrupt === "b") {
|
||||
node.send(msg);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
node.status({fill:"grey",shape:"ring",text:"unknown"});
|
||||
}
|
||||
}
|
||||
});
|
||||
switch (node.x.read()) {
|
||||
case 0:
|
||||
case 0: {
|
||||
node.status({fill:"green",shape:"ring",text:"low"});
|
||||
break;
|
||||
case 1:
|
||||
}
|
||||
case 1: {
|
||||
node.status({fill:"green",shape:"dot",text:"high"});
|
||||
break;
|
||||
default:
|
||||
}
|
||||
default: {
|
||||
node.status({});
|
||||
}
|
||||
}
|
||||
this.on('close', function() {
|
||||
node.x.isr(m.EDGE_BOTH, null);
|
||||
|
@@ -10,7 +10,8 @@ module.exports = function(RED) {
|
||||
var node = this;
|
||||
if (node.pin === 14) {
|
||||
node.p = new m.Gpio(3,false,true); // special for onboard LED v1
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
node.p = new m.Gpio(node.pin);
|
||||
}
|
||||
node.p.mode(m.PIN_GPIO);
|
||||
@@ -21,7 +22,8 @@ module.exports = function(RED) {
|
||||
node.on("input", function(msg) {
|
||||
if (msg.payload == "1") {
|
||||
node.p.write(1);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
node.p.write(0);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user