mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 01:07:10 +00:00
Improve time condition trace (#51335)
This commit is contained in:
parent
fb281c6bde
commit
63e16de6c0
@ -756,15 +756,18 @@ def time(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if after < before:
|
if after < before:
|
||||||
|
condition_trace_update_result(after=after, now_time=now_time, before=before)
|
||||||
if not after <= now_time < before:
|
if not after <= now_time < before:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
|
condition_trace_update_result(after=after, now_time=now_time, before=before)
|
||||||
if before <= now_time < after:
|
if before <= now_time < after:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if weekday is not None:
|
if weekday is not None:
|
||||||
now_weekday = WEEKDAYS[now.weekday()]
|
now_weekday = WEEKDAYS[now.weekday()]
|
||||||
|
|
||||||
|
condition_trace_update_result(weekday=weekday, now_weekday=now_weekday)
|
||||||
if (
|
if (
|
||||||
isinstance(weekday, str)
|
isinstance(weekday, str)
|
||||||
and weekday != now_weekday
|
and weekday != now_weekday
|
||||||
|
Loading…
x
Reference in New Issue
Block a user