From 1f9ed8a256d1180969f758b2066edb9083a5cc4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?So=CC=88ren=20Mu=CC=88ller?= Date: Tue, 4 Jun 2019 20:49:38 +0200 Subject: [PATCH] Duplicate calls removed --- homeassistant/components/avea/light.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/avea/light.py b/homeassistant/components/avea/light.py index 0c74d81df57..761a502d0f6 100644 --- a/homeassistant/components/avea/light.py +++ b/homeassistant/components/avea/light.py @@ -83,9 +83,10 @@ class AveaLight(Light): This is the only method that should fetch new data for Home Assistant. """ - if self._light.get_brightness() == 0: + brightness = self._light.get_brightness() + if brightness == 0: self._state = False else: self._state = True - bright_percent = round((self._light.get_brightness()/4095)*100) + bright_percent = round((brightness/4095)*100) self._brightness = round(255 * (bright_percent / 100))