mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Only create one executor job to shutdown wemo (#113836)
Currently we created two but the work can be done in a single job
This commit is contained in:
parent
ec3db0a6aa
commit
b26f0bc488
@ -92,11 +92,13 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||||||
discovery_responder = pywemo.ssdp.DiscoveryResponder(registry.port)
|
discovery_responder = pywemo.ssdp.DiscoveryResponder(registry.port)
|
||||||
await hass.async_add_executor_job(discovery_responder.start)
|
await hass.async_add_executor_job(discovery_responder.start)
|
||||||
|
|
||||||
async def _on_hass_stop(_: Event) -> None:
|
def _on_hass_stop(_: Event) -> None:
|
||||||
await hass.async_add_executor_job(discovery_responder.stop)
|
discovery_responder.stop()
|
||||||
await hass.async_add_executor_job(registry.stop)
|
registry.stop()
|
||||||
|
|
||||||
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _on_hass_stop)
|
hass.bus.async_listen_once(
|
||||||
|
EVENT_HOMEASSISTANT_STOP, _on_hass_stop, run_immediately=True
|
||||||
|
)
|
||||||
|
|
||||||
yaml_config = config.get(DOMAIN, {})
|
yaml_config = config.get(DOMAIN, {})
|
||||||
hass.data[DOMAIN] = WemoData(
|
hass.data[DOMAIN] = WemoData(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user