From 805758395e72edbb6033cbb20890826a16f2e6af Mon Sep 17 00:00:00 2001 From: madmod Date: Sat, 27 Jun 2015 17:01:44 -0600 Subject: [PATCH] improved color accuracy --- platforms/PhilipsHue.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platforms/PhilipsHue.js b/platforms/PhilipsHue.js index 3da6569..7913f80 100644 --- a/platforms/PhilipsHue.js +++ b/platforms/PhilipsHue.js @@ -60,6 +60,9 @@ var execute = function(api, device, characteristic, value) { } } else if (characteristic === "hue") { + value = value/360; + value = value*65535; + value = Math.round(value); state.hue(value); } else if (characteristic === "brightness") { @@ -198,7 +201,7 @@ PhilipsHueAccessory.prototype = { supportBonjour: false, manfDescription: "Adjust Hue of Light", designedMinValue: 0, - designedMaxValue: 65535, + designedMaxValue: 360, designedMinStep: 1, unit: "arcdegrees" },{