light.blinkt: update brightness control logic (#7389)

Always use the current brightness, as per discussion at
https://github.com/home-assistant/home-assistant/pull/7377#discussion_r114102005
pull/7409/head
Gergely Imreh 2017-05-02 17:35:23 +01:00 committed by Fabian Affolter
parent a4f1f6e724
commit 12c8266942
1 changed files with 3 additions and 3 deletions

View File

@ -96,12 +96,12 @@ class BlinktLight(Light):
def turn_on(self, **kwargs):
"""Instruct the light to turn on and set correct brightness & color."""
self._brightness = kwargs.get(ATTR_BRIGHTNESS, 255)
percent_bright = (self._brightness / 255)
if ATTR_RGB_COLOR in kwargs:
self._rgb_color = kwargs[ATTR_RGB_COLOR]
if ATTR_BRIGHTNESS in kwargs:
self._brightness = kwargs[ATTR_BRIGHTNESS]
percent_bright = (self._brightness / 255)
self._blinkt.set_all(self._rgb_color[0],
self._rgb_color[1],
self._rgb_color[2],