Improve time condition trace (#51335)

This commit is contained in:
Erik Montnemery
2021-06-01 17:07:45 +02:00
committed by GitHub
parent fb281c6bde
commit 63e16de6c0

View File

@@ -756,15 +756,18 @@ def time(
)
if after < before:
condition_trace_update_result(after=after, now_time=now_time, before=before)
if not after <= now_time < before:
return False
else:
condition_trace_update_result(after=after, now_time=now_time, before=before)
if before <= now_time < after:
return False
if weekday is not None:
now_weekday = WEEKDAYS[now.weekday()]
condition_trace_update_result(weekday=weekday, now_weekday=now_weekday)
if (
isinstance(weekday, str)
and weekday != now_weekday