Skip to content

Commit

Permalink
Fix bug that changed brightness at each hsv update
Browse files Browse the repository at this point in the history
The HSV setter should accept a percentage for the brightness
value but actually assumed the brightness to be in absolute values
between 1 and 255.
This resulted in brightness reductions at each HSV update, in
steps of 100% -> 100/255=39% -> 39/255=15% -> ... (see also
home-assistant/core#15582,
where I originally reported this bug).
  • Loading branch information
Sebastian Templ committed Jul 22, 2018
1 parent e612560 commit 8761dd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyHS100/smartbulb.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def hsv(self, state: Tuple[int, int, int]):
light_state = {
"hue": state[0],
"saturation": state[1],
"brightness": int(state[2] * 100 / 255),
"brightness": state[2],
"color_temp": 0
}
self.set_light_state(light_state)
Expand Down

0 comments on commit 8761dd8

Please sign in to comment.