Skip to content

Commit

Permalink
Fixed light bulb hue and saturation, closes sibartlett#16
Browse files Browse the repository at this point in the history
  • Loading branch information
sibartlett committed Jun 5, 2017
1 parent 0ab8d17 commit a669882
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/devices/light_bulb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
}
},
Expand All @@ -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
};
}
Expand Down

0 comments on commit a669882

Please sign in to comment.