mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Avoid creating tasks in homeassistant_alerts when the debouncer will not fire (#113580)
This commit is contained in:
parent
4174d88ad7
commit
bb12d2e865
@ -98,11 +98,14 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||||||
function=coordinator.async_refresh,
|
function=coordinator.async_refresh,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def _component_loaded(_: Event) -> None:
|
@callback
|
||||||
await refresh_debouncer.async_call()
|
def _component_loaded(_: Event) -> None:
|
||||||
|
refresh_debouncer.async_schedule_call()
|
||||||
|
|
||||||
await coordinator.async_refresh()
|
await coordinator.async_refresh()
|
||||||
hass.bus.async_listen(EVENT_COMPONENT_LOADED, _component_loaded)
|
hass.bus.async_listen(
|
||||||
|
EVENT_COMPONENT_LOADED, _component_loaded, run_immediately=True
|
||||||
|
)
|
||||||
|
|
||||||
async_at_start(hass, initial_refresh)
|
async_at_start(hass, initial_refresh)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user