Wait to start emulated_hue until the started event (#112477)
parent
8770a50859
commit
72ac2f127f
|
@ -10,7 +10,7 @@ from homeassistant.components.network import async_get_source_ip
|
|||
from homeassistant.const import (
|
||||
CONF_ENTITIES,
|
||||
CONF_TYPE,
|
||||
EVENT_HOMEASSISTANT_START,
|
||||
EVENT_HOMEASSISTANT_STARTED,
|
||||
EVENT_HOMEASSISTANT_STOP,
|
||||
)
|
||||
from homeassistant.core import Event, HomeAssistant
|
||||
|
@ -153,6 +153,6 @@ async def async_setup(hass: HomeAssistant, yaml_config: ConfigType) -> bool:
|
|||
"""Start the bridge."""
|
||||
await start_emulated_hue_bridge(hass, config, app)
|
||||
|
||||
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_START, _start)
|
||||
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STARTED, _start)
|
||||
|
||||
return True
|
||||
|
|
|
@ -12,7 +12,7 @@ from homeassistant.components.emulated_hue.config import (
|
|||
Config,
|
||||
)
|
||||
from homeassistant.components.emulated_hue.upnp import UPNPResponderProtocol
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_START
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_STARTED
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.util import utcnow
|
||||
|
@ -145,7 +145,7 @@ async def test_setup_works(hass: HomeAssistant) -> None:
|
|||
spec=UPNPResponderProtocol
|
||||
)
|
||||
assert await async_setup_component(hass, "emulated_hue", {})
|
||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_START)
|
||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_STARTED)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert len(mock_create_upnp_datagram_endpoint.mock_calls) == 1
|
||||
|
|
Loading…
Reference in New Issue