mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
Remove executor calls in isy994 as its fully async (#57394)
This commit is contained in:
parent
be8724a6f8
commit
45b60b8346
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user