Fixed brightness reducing after each light change (#22606)

self._brightness max is 255 and hsv brightness max is 100. Assigning 255 based brightness value directly with 100 based hsv reduces brightness eventually to zero.
This commit is contained in:
N1nja98 2019-04-01 01:27:47 -05:00 committed by Rohan Kapoor
parent 7bd8c0d39a
commit a61181b10c

View File

@ -157,6 +157,6 @@ class ZenggeLight(Light):
rgb = self._bulb.get_colour() rgb = self._bulb.get_colour()
hsv = color_util.color_RGB_to_hsv(*rgb) hsv = color_util.color_RGB_to_hsv(*rgb)
self._hs_color = hsv[:2] self._hs_color = hsv[:2]
self._brightness = hsv[2] self._brightness = (hsv[2] / 100) * 255
self._white = self._bulb.get_white() self._white = self._bulb.get_white()
self._state = self._bulb.get_on() self._state = self._bulb.get_on()