mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Run functions from ssdp listeners immediately (#113634)
This commit is contained in:
parent
cede6af496
commit
513da0f71e
@ -392,7 +392,9 @@ class Scanner:
|
|||||||
|
|
||||||
await self._async_start_ssdp_listeners()
|
await self._async_start_ssdp_listeners()
|
||||||
|
|
||||||
self.hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, self.async_stop)
|
self.hass.bus.async_listen_once(
|
||||||
|
EVENT_HOMEASSISTANT_STOP, self.async_stop, run_immediately=True
|
||||||
|
)
|
||||||
self._cancel_scan = async_track_time_interval(
|
self._cancel_scan = async_track_time_interval(
|
||||||
self.hass, self.async_scan, SCAN_INTERVAL, name="SSDP scanner"
|
self.hass, self.async_scan, SCAN_INTERVAL, name="SSDP scanner"
|
||||||
)
|
)
|
||||||
@ -752,9 +754,13 @@ class Server:
|
|||||||
async def async_start(self) -> None:
|
async def async_start(self) -> None:
|
||||||
"""Start the server."""
|
"""Start the server."""
|
||||||
bus = self.hass.bus
|
bus = self.hass.bus
|
||||||
bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, self.async_stop)
|
|
||||||
bus.async_listen_once(
|
bus.async_listen_once(
|
||||||
EVENT_HOMEASSISTANT_STARTED, self._async_start_upnp_servers
|
EVENT_HOMEASSISTANT_STOP, self.async_stop, run_immediately=True
|
||||||
|
)
|
||||||
|
bus.async_listen_once(
|
||||||
|
EVENT_HOMEASSISTANT_STARTED,
|
||||||
|
self._async_start_upnp_servers,
|
||||||
|
run_immediately=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def _async_get_instance_udn(self) -> str:
|
async def _async_get_instance_udn(self) -> str:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user