some good old linting

This commit is contained in:
Dave Conway-Jones
2025-08-26 17:13:34 +01:00
parent 67f5b8150d
commit ffc14d0439
4 changed files with 6 additions and 5 deletions

View File

@@ -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"});

View File

@@ -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; }

View File

@@ -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*/
}