From a6698828601e672f39b57967e80f7178d9df6662 Mon Sep 17 00:00:00 2001 From: Simon Bartlett Date: Mon, 5 Jun 2017 09:29:36 -0400 Subject: [PATCH] Fixed light bulb hue and saturation, closes #16 --- src/devices/light_bulb.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/devices/light_bulb.js b/src/devices/light_bulb.js index bda50e4..d77bc40 100644 --- a/src/devices/light_bulb.js +++ b/src/devices/light_bulb.js @@ -28,12 +28,12 @@ export default ({ Characteristic, Service }) => { supported: state => state.hue !== undefined, get: state => Math.floor(state.hue * 360), set: (value, accessory) => { - const values = accessory.merged_values; + const state = accessory.merged_state; return { - brightness: values.brightness, + brightness: state.brightness, color_model: "hsb", hue: value / 360, - saturation: values.saturation + saturation: state.saturation }; } }, @@ -42,11 +42,11 @@ export default ({ Characteristic, Service }) => { supported: state => state.saturation !== undefined, get: state => Math.floor(state.saturation * 100), set: (value, accessory) => { - const values = accessory.merged_values; + const state = accessory.merged_state; return { - brightness: values.brightness, + brightness: state.brightness, color_model: "hsb", - hue: values.hue, + hue: state.hue, saturation: value / 360 }; }