From 6063ebdd3c05c8eac401b4102dac846334c7a13d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren?= Date: Tue, 4 Jun 2019 14:19:01 +0200 Subject: [PATCH] Improved readability Co-Authored-By: Otto Winter --- homeassistant/components/avea/light.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/avea/light.py b/homeassistant/components/avea/light.py index fd6a44b4311..3342ebaf277 100644 --- a/homeassistant/components/avea/light.py +++ b/homeassistant/components/avea/light.py @@ -68,7 +68,8 @@ class AveaLight(Light): else: if ATTR_BRIGHTNESS in kwargs: bright_percent = round((kwargs.get(ATTR_BRIGHTNESS, 255)/255)*100) - self._light.set_brightness(round(4095 * (bright_percent / 100))); + bright = round((kwargs[ATTR_BRIGHTNESS] / 255) * 4095) + self._light.set_brightness(bright) if ATTR_HS_COLOR in kwargs: rgb = color_util.color_hs_to_RGB(*kwargs[ATTR_HS_COLOR]) self._light.set_rgb(round(255 * (rgb[0] / 100)), round(255 * (rgb[1] / 100)), round(255 * (rgb[2] / 100)));