mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-12-26 23:16:47 +01:00
some good old linting
This commit is contained in:
@@ -107,7 +107,7 @@ module.exports = function(RED) {
|
||||
if (msg.payload === "true") { msg.payload = true; }
|
||||
if (msg.payload === "false") { msg.payload = false; }
|
||||
var out = Number(msg.payload);
|
||||
if ((out === 0)|(out === 1)) {
|
||||
if ((out === 0)||(out === 1)) {
|
||||
exec("gpio -p write "+node.pin+" "+out, function(err,stdout,stderr) {
|
||||
if (err) {
|
||||
node.status({fill:"red",shape:"ring",text:"error"});
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
|
||||
module.exports = function(RED) {
|
||||
"use strict";
|
||||
var util = require("util");
|
||||
var spawn = require('child_process').spawn;
|
||||
var fs = require('fs');
|
||||
|
||||
@@ -59,7 +58,7 @@ module.exports = function(RED) {
|
||||
node.child = spawn(gpioCommand, ["byte",node.dir]);
|
||||
node.on("input", function(msg) {
|
||||
var out = msg.payload;
|
||||
if ((out === 1)|(out === true)|(out === "1")|(out === "on")) {
|
||||
if ((out === 1)||(out === true)||(out === "1")||(out === "on")) {
|
||||
out = 255;
|
||||
}
|
||||
else { out = 0; }
|
||||
|
||||
@@ -8,7 +8,9 @@ module.exports = function(RED) {
|
||||
if (this.pin == 0) {
|
||||
this.user1_green = new m.Led(0); /*user-led1-green*/
|
||||
this.user1_red = new m.Led(1); /*user-led1-red*/
|
||||
} if(this.pin == 1) {
|
||||
}
|
||||
|
||||
if (this.pin == 1) {
|
||||
this.user2_green = new m.Led(2); /*user-led2-green*/
|
||||
this.user2_red = new m.Led(3); /*user-led2-red*/
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ module.exports = function(RED) {
|
||||
const topic = node.topic || msg.topic;
|
||||
if (topic.length > 0) {
|
||||
node.serverConnection.ack(topic, msg.messageId, msg.transaction);
|
||||
} else if (!topic.length > 0) {
|
||||
} else if (!(topic.length > 0)) {
|
||||
node.warn('No valid publish topic');
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user