mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +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.
|
# Load platforms for the devices in the ISY controller that we support.
|
||||||
hass.config_entries.async_setup_platforms(entry, PLATFORMS)
|
hass.config_entries.async_setup_platforms(entry, PLATFORMS)
|
||||||
|
|
||||||
def _start_auto_update() -> None:
|
@callback
|
||||||
"""Start isy auto update."""
|
def _async_stop_auto_update(event) -> None:
|
||||||
_LOGGER.debug("ISY Starting Event Stream and automatic updates")
|
|
||||||
isy.websocket.start()
|
|
||||||
|
|
||||||
def _stop_auto_update(event) -> None:
|
|
||||||
"""Stop the isy auto update on Home Assistant Shutdown."""
|
"""Stop the isy auto update on Home Assistant Shutdown."""
|
||||||
_LOGGER.debug("ISY Stopping Event Stream and automatic updates")
|
_LOGGER.debug("ISY Stopping Event Stream and automatic updates")
|
||||||
isy.websocket.stop()
|
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(entry.add_update_listener(_async_update_listener))
|
||||||
entry.async_on_unload(
|
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:
|
# Register Integration-wide Services:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user