sun and pattern time changes from automations also block startup

pull/112640/head
J. Nick Koston 2024-03-07 12:28:22 -10:00
parent 4a1a0e70e8
commit 6de2defa05
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -1694,7 +1694,7 @@ class SunListener:
"""Handle solar event.""" """Handle solar event."""
self._unsub_sun = None self._unsub_sun = None
self._listen_next_sun_event() self._listen_next_sun_event()
self.hass.async_run_hass_job(self.job) self.hass.async_run_periodic_hass_job(self.job)
@callback @callback
def _handle_config_event(self, _event: Any) -> None: def _handle_config_event(self, _event: Any) -> None:
@ -1780,7 +1780,7 @@ class _TrackUTCTimeChange:
# time when the timer was scheduled # time when the timer was scheduled
utc_now = time_tracker_utcnow() utc_now = time_tracker_utcnow()
localized_now = dt_util.as_local(utc_now) if self.local else utc_now localized_now = dt_util.as_local(utc_now) if self.local else utc_now
hass.async_run_hass_job(self.job, localized_now) hass.async_run_periodic_hass_job(self.job, localized_now)
if TYPE_CHECKING: if TYPE_CHECKING:
assert self._pattern_time_change_listener_job is not None assert self._pattern_time_change_listener_job is not None
self._cancel_callback = async_track_point_in_utc_time( self._cancel_callback = async_track_point_in_utc_time(