Fix sending multiple empty integration timing in bootstrap (#110872)

This commit is contained in:
J. Nick Koston 2024-02-18 12:53:05 -06:00 committed by GitHub
parent e879ab0eef
commit 3633700d97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -569,10 +569,7 @@ class _WatchPendingSetups:
for domain, start_time in self._setup_started.items()
}
_LOGGER.debug("Integration remaining: %s", remaining_with_setup_started)
if remaining_with_setup_started or not self._previous_was_empty:
self._async_dispatch(remaining_with_setup_started)
self._previous_was_empty = not remaining_with_setup_started
self._async_dispatch(remaining_with_setup_started)
if (
self._setup_started
and self._duration_count % LOG_SLOW_STARTUP_INTERVAL == 0
@ -589,9 +586,11 @@ class _WatchPendingSetups:
def _async_dispatch(self, remaining_with_setup_started: dict[str, float]) -> None:
"""Dispatch the signal."""
async_dispatcher_send(
self._hass, SIGNAL_BOOTSTRAP_INTEGRATIONS, remaining_with_setup_started
)
if remaining_with_setup_started or not self._previous_was_empty:
async_dispatcher_send(
self._hass, SIGNAL_BOOTSTRAP_INTEGRATIONS, remaining_with_setup_started
)
self._previous_was_empty = not remaining_with_setup_started
def _async_schedule_next(self) -> None:
"""Schedule the next call."""