From b5f1f1fd3152dc1c5e3be85824298c1f2197fa33 Mon Sep 17 00:00:00 2001 From: GadgetAngel Date: Sat, 20 Apr 2019 22:57:29 -0400 Subject: [PATCH] correct file sorry for the screw up.....must be getting tired --- tuya-color.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tuya-color.js b/tuya-color.js index 84b58c1..d9d41f2 100644 --- a/tuya-color.js +++ b/tuya-color.js @@ -181,26 +181,20 @@ TuyaColorLight.prototype.setHSL = function (hue, saturation, brightness) { this.setHue(hue); } -TuyaColorLight.prototype._stripBraces = function (string) { - return string.slice(1,-1); -} /** * Set color from given string * @param {String} colorValue could be HEX or HSL color type * @returns {Object} dps settings for given color */ TuyaColorLight.prototype.setColor = function (colorValue) { - var colorValue2; + debug("Recieved color", colorValue); - debug("Received color", colorValue); - colorValue2 = this._stripBraces(colorValue); - debug("colorValue2 = "+colorValue2); - if (this._ValIsHex(colorValue2)) { + if (this._ValIsHex(colorValue)) { debug("Color is Hex"); - color = convert.hex.hsl(colorValue2); + var color = convert.hex.hsl(colorValue); } else { debug("Color is HSL"); - var color = colorValue2.split(","); + var color = colorValue.split(","); // convert strings to numbers color.forEach(function (element, key) { color[key] = parseInt(element, 10); @@ -250,4 +244,4 @@ TuyaColorLight.prototype.getDps = function () { return dpsTmp; } -module.exports = TuyaColorLight; +module.exports = TuyaColorLight; \ No newline at end of file