diff --git a/hardware/blinkstick/76-blinkstick.js b/hardware/blinkstick/76-blinkstick.js index 0c1859f1..25fea9f9 100644 --- a/hardware/blinkstick/76-blinkstick.js +++ b/hardware/blinkstick/76-blinkstick.js @@ -15,7 +15,7 @@ module.exports = function(RED) { //Helper function to convert decimal number to hex with padding function decimalToHex(d, padding) { var hex = Number(d).toString(16); - padding = typeof (padding) === "undefined" || padding === null ? padding = 2 : padding; + padding = (typeof padding === "undefined" || padding === null) ? 2 : padding; while (hex.length < padding) { hex = "0" + hex; @@ -25,15 +25,15 @@ module.exports = function(RED) { } function validateInt(value, defaultValue) { - return typeof (value) === "undefined" || value === null ? value = defaultValue : parseInt(value); + return (typeof value === "undefined" || value === null) ? defaultValue : parseInt(value); } function validate(value, defaultValue) { - return typeof (value) === "undefined" || value === null ? value = defaultValue : value; + return (typeof value === "undefined" || value === null) ? defaultValue : value; } function validateArray(value, defaultValue) { - return typeof (value) === "undefined" || Array.isArray(value) ? value : defaultValue; + return (typeof value === "undefined" || Array.isArray(value)) ? value : defaultValue; } function validatePayloadObject (obj) { diff --git a/hardware/blinkstick/blinkstick.js b/hardware/blinkstick/blinkstick.js index 389dd605..2018e355 100644 --- a/hardware/blinkstick/blinkstick.js +++ b/hardware/blinkstick/blinkstick.js @@ -26,7 +26,7 @@ module.exports = function(RED) { function BlinkStick(n) { RED.nodes.createNode(this,n); - var p1 = /^\#[A-Fa-f0-9]{6}$/ + //var p1 = /^\#[A-Fa-f0-9]{6}$/ var p2 = /[0-9]+,[0-9]+,[0-9]+/ this.led = blinkstick.findFirst(); // maybe try findAll() (one day) var node = this;