simplify some more

This commit is contained in:
J. Nick Koston
2020-07-20 22:59:34 +00:00
parent 3b13714ef4
commit 2a6c57d514

View File

@@ -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:
next_time = calculate_next(now + timedelta(seconds=1))
else:
next_time = calculate_next(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))
cancel_callback = hass.loop.call_at(
hass.loop.time() + next_time.timestamp() - time.time(),