From 3bbaf37193fe147f66b17d848f646f4400aa6278 Mon Sep 17 00:00:00 2001 From: Tsvi Mostovicz Date: Mon, 19 Jun 2017 10:54:13 +0300 Subject: [PATCH] Fix lights issue #8098 (#8101) * Fix lights issue #8098 * Don't check self._color to decide whether to calll get_color() self._color is None on init, so get_color() will never be called. --- homeassistant/components/light/vera.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/light/vera.py b/homeassistant/components/light/vera.py index ad24c1872f5..3d19c3fcea2 100644 --- a/homeassistant/components/light/vera.py +++ b/homeassistant/components/light/vera.py @@ -79,5 +79,8 @@ class VeraLight(VeraDevice, Light): def update(self): """Call to update state.""" self._state = self.vera_device.is_switched_on() - self._brightness = self.vera_device.get_brightness() - self._color = self.vera_device.get_color() + if self.vera_device.is_dimmable: + # If it is dimmable, both functions exist. In case color + # is not supported, it will return None + self._brightness = self.vera_device.get_brightness() + self._color = self.vera_device.get_color()