diff --git a/homeassistant/components/light/piglow.py b/homeassistant/components/light/piglow.py index d08776551f8..40798810c0e 100644 --- a/homeassistant/components/light/piglow.py +++ b/homeassistant/components/light/piglow.py @@ -72,6 +72,16 @@ class PiglowLight(Light): """Flag supported features.""" return SUPPORT_PIGLOW + @property + def should_poll(self): + """Return if we should poll this device.""" + return False + + @property + def assumed_state(self) -> bool: + """Return True if unable to access real state of the entity.""" + return True + @property def is_on(self): """Return true if light is on.""" @@ -80,7 +90,9 @@ class PiglowLight(Light): def turn_on(self, **kwargs): """Instruct the light to turn on.""" self._piglow.clear() - self._brightness = kwargs.get(ATTR_BRIGHTNESS, 255) + + if ATTR_BRIGHTNESS in kwargs: + self._brightness = kwargs[ATTR_BRIGHTNESS] percent_bright = (self._brightness / 255) if ATTR_RGB_COLOR in kwargs: @@ -92,9 +104,11 @@ class PiglowLight(Light): self._piglow.all(self._brightness) self._piglow.show() self._is_on = True + self.schedule_update_ha_state() def turn_off(self, **kwargs): """Instruct the light to turn off.""" self._piglow.clear() self._piglow.show() self._is_on = False + self.schedule_update_ha_state()