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.
This commit is contained in:
Tsvi Mostovicz 2017-06-19 10:54:13 +03:00 committed by Pascal Vizeli
parent b2d6ff9783
commit 3bbaf37193

View file

@ -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()