How to use the wled.WLEDError function in wled

To help you get started, we’ve selected a few wled examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github home-assistant / home-assistant / homeassistant / components / wled / light.py View on Github external
async def async_turn_off(self, **kwargs: Any) -> None:
        """Turn off the light."""
        try:
            await self.wled.light(on=False)
            self._state = False
        except WLEDError:
            _LOGGER.error("An error occurred while turning off WLED light.")
            self._available = False
        self.async_schedule_update_ha_state()
github home-assistant / home-assistant / homeassistant / components / wled / __init__.py View on Github external
async def interval_update(now: dt_util.dt.datetime = None) -> None:
        """Poll WLED device function, dispatches event after update."""
        try:
            await wled.update()
        except WLEDError:
            _LOGGER.debug("An error occurred while updating WLED", exc_info=True)

        # Even if the update failed, we still send out the event.
        # To allow entities to make themselves unavailable.
        async_dispatcher_send(hass, DATA_WLED_UPDATED, entry.entry_id)