From 12c8266942fe2ef6ed45da8788df877d2d46e166 Mon Sep 17 00:00:00 2001 From: Gergely Imreh Date: Tue, 2 May 2017 17:35:23 +0100 Subject: [PATCH] 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 --- homeassistant/components/light/blinkt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/light/blinkt.py b/homeassistant/components/light/blinkt.py index af8c33801fa..ffd3c102c7f 100644 --- a/homeassistant/components/light/blinkt.py +++ b/homeassistant/components/light/blinkt.py @@ -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],