lots of little node edits to clean up jsHint "errors"

This commit is contained in:
dceejay
2015-03-26 18:55:03 +00:00
parent 8eca22bdc3
commit d511ee69fb
18 changed files with 478 additions and 328 deletions

View File

@@ -49,7 +49,7 @@ module.exports = function (RED) {
setPinMode = function (pin, direction, callback) {
bonescript.pinMode(pin, direction, undefined, undefined, undefined, callback);
}
} catch (e) {
} catch (er) {
throw "Info : Ignoring Beaglebone specific node.";
}
}
@@ -119,10 +119,11 @@ module.exports = function (RED) {
this.topic = n.topic; // the topic is not currently used
this.pin = n.pin; // The Beaglebone Black pin identifying string
this._pin = adjustName(this.pin); // Adjusted for Octal if necessary
if (n.activeLow) // Set the 'active' state 0 or 1 as appropriate
if (n.activeLow) { // Set the 'active' state 0 or 1 as appropriate
this.activeState = 0;
else
} else {
this.activeState = 1;
}
this.updateInterval = n.updateInterval*1000; // How often to send totalActiveTime messages
this.debounce = n.debounce; // Enable switch contact debouncing algorithm
if (n.outputOn === "rising") {
@@ -229,7 +230,7 @@ module.exports = function (RED) {
// payload, if possible. Otherwise clear the totalActiveTime (so we start counting
// from zero again)
var inputCallback = function (ipMsg) {
if (String(ipMsg.topic).search(/load/i) < 0 || isFinite(ipMsg.payload) == false) {
if (String(ipMsg.topic).search(/load/i) < 0 || isFinite(ipMsg.payload) === false) {
node.totalActiveTime = 0;
} else {
node.totalActiveTime = Number(ipMsg.payload);
@@ -327,7 +328,7 @@ module.exports = function (RED) {
// insensitive) and the payload is a valid number, set the count to that
// number, otherwise set it to zero
var inputCallback = function (msg) {
if (String(msg.topic).search(/load/i) < 0 || isFinite(msg.payload) == false) {
if (String(msg.topic).search(/load/i) < 0 || isFinite(msg.payload) === false) {
node.pulseCount = 0;
} else {
node.pulseCount = Number(msg.payload);

View File

@@ -1,6 +1,6 @@
{
"name" : "node-red-node-beaglebone",
"version" : "0.0.6",
"version" : "0.0.7",
"description" : "A set of Node-RED nodes to interface to the GPIO pins of a Beaglebone Black board",
"dependencies" : {
},