diff --git a/homeassistant/components/isy994/__init__.py b/homeassistant/components/isy994/__init__.py index 02bbea29bdb..a5ceeaea1d8 100644 --- a/homeassistant/components/isy994/__init__.py +++ b/homeassistant/components/isy994/__init__.py @@ -205,21 +205,18 @@ async def async_setup_entry( # Load platforms for the devices in the ISY controller that we support. hass.config_entries.async_setup_platforms(entry, PLATFORMS) - def _start_auto_update() -> None: - """Start isy auto update.""" - _LOGGER.debug("ISY Starting Event Stream and automatic updates") - isy.websocket.start() - - def _stop_auto_update(event) -> None: + @callback + def _async_stop_auto_update(event) -> None: """Stop the isy auto update on Home Assistant Shutdown.""" _LOGGER.debug("ISY Stopping Event Stream and automatic updates") isy.websocket.stop() - await hass.async_add_executor_job(_start_auto_update) + _LOGGER.debug("ISY Starting Event Stream and automatic updates") + isy.websocket.start() entry.async_on_unload(entry.add_update_listener(_async_update_listener)) entry.async_on_unload( - hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _stop_auto_update) + hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _async_stop_auto_update) ) # Register Integration-wide Services: