OPT-27 round 2: a kept tomorrow figure is bounded on both sides
Hold.stand_in(): day0 <= now < day0 + 3 h. A tomorrow sensor is asked with day0 = the next midnight, so the upper bound alone was true all day and a figure stood in at any hour. test_opt27.py covers daytime tomorrow outages. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
1eb572f513
commit
f095ca9268
@@ -315,7 +315,9 @@ class Hold:
|
||||
day, at = rec
|
||||
if (now - at).total_seconds() <= FRESH_S and not as_today:
|
||||
return day, at, False
|
||||
after_midnight = now < day0 + timedelta(hours=KEPT_UNTIL_H)
|
||||
# Both sides: a tomorrow sensor is asked with day0 = the next
|
||||
# midnight, which is in the future all day (round 2).
|
||||
after_midnight = day0 <= now < day0 + timedelta(hours=KEPT_UNTIL_H)
|
||||
evening = _local_hour(now) >= BELL_TO_H and now < day0 + timedelta(
|
||||
days=1)
|
||||
if as_today:
|
||||
|
||||
Reference in New Issue
Block a user