Fix zeroconf shutting down too early (#113638)
This commit is contained in:
parent
513da0f71e
commit
fa68c5633c
2 changed files with 19 additions and 3 deletions
|
@ -15,6 +15,7 @@ from zeroconf.asyncio import AsyncServiceInfo
|
|||
from homeassistant.components import zeroconf
|
||||
from homeassistant.const import (
|
||||
EVENT_COMPONENT_LOADED,
|
||||
EVENT_HOMEASSISTANT_CLOSE,
|
||||
EVENT_HOMEASSISTANT_START,
|
||||
EVENT_HOMEASSISTANT_STARTED,
|
||||
EVENT_HOMEASSISTANT_STOP,
|
||||
|
@ -935,6 +936,11 @@ async def test_get_instance(hass: HomeAssistant, mock_async_zeroconf: None) -> N
|
|||
)
|
||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_STOP)
|
||||
await hass.async_block_till_done()
|
||||
assert len(mock_async_zeroconf.ha_async_close.mock_calls) == 0
|
||||
# Only shutdown at the close event so integrations have time
|
||||
# to send out their goodbyes
|
||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_CLOSE)
|
||||
await hass.async_block_till_done()
|
||||
assert len(mock_async_zeroconf.ha_async_close.mock_calls) == 1
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue