mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Fix dangling task for homeassistant integration (#88288)
This commit is contained in:
parent
509d968814
commit
0904848579
@ -156,7 +156,8 @@ async def async_setup(hass: ha.HomeAssistant, config: ConfigType) -> bool: # no
|
||||
)
|
||||
|
||||
if call.service == SERVICE_HOMEASSISTANT_STOP:
|
||||
asyncio.create_task(hass.async_stop())
|
||||
# Track trask in hass.data. No need to cleanup, we're stopping.
|
||||
hass.data["homeassistant_stop"] = asyncio.create_task(hass.async_stop())
|
||||
return
|
||||
|
||||
errors = await conf_util.async_check_ha_config_file(hass)
|
||||
@ -179,7 +180,10 @@ async def async_setup(hass: ha.HomeAssistant, config: ConfigType) -> bool: # no
|
||||
)
|
||||
|
||||
if call.service == SERVICE_HOMEASSISTANT_RESTART:
|
||||
asyncio.create_task(hass.async_stop(RESTART_EXIT_CODE))
|
||||
# Track trask in hass.data. No need to cleanup, we're stopping.
|
||||
hass.data["homeassistant_stop"] = asyncio.create_task(
|
||||
hass.async_stop(RESTART_EXIT_CODE)
|
||||
)
|
||||
|
||||
async def async_handle_update_service(call: ha.ServiceCall) -> None:
|
||||
"""Service handler for updating an entity."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user