mirror of
https://github.com/home-assistant/core.git
synced 2025-08-01 19:55:10 +02:00
simplify some more
This commit is contained in:
@@ -615,10 +615,10 @@ def async_track_utc_time_change(
|
||||
now = pattern_utc_now()
|
||||
hass.async_run_job(action, dt_util.as_local(now) if local else now)
|
||||
|
||||
if next_time <= now:
|
||||
# We only want second level precision for time patterns
|
||||
# as we do not want to fire them multiple times in
|
||||
# the same second.
|
||||
next_time = calculate_next(now + timedelta(seconds=1))
|
||||
else:
|
||||
next_time = calculate_next(now)
|
||||
|
||||
cancel_callback = hass.loop.call_at(
|
||||
hass.loop.time() + next_time.timestamp() - time.time(),
|
||||
|
Reference in New Issue
Block a user