MAINT-25: the Home plan shows no cycle during the 7-day back-off
checks / unit (pull_request) Successful in 27m21s
infra-pin / fresh (pull_request) Successful in 1s

homeview.maintenance_runs() ignored backoff_until(); it drew a cycle every
night of the wait. Now no run and a plain line (EN, NL). test_maint25.py.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
glenn schrooyen
2026-11-12 09:57:56 +01:00
co-authored by Claude
parent b80cfa969f
commit de0790e62d
5 changed files with 223 additions and 1 deletions
+14
View File
@@ -630,6 +630,11 @@ def maintenance_runs(c, day0, day1, now, shadow):
run_cycle_why(shadow),
run_cycle_amount(hours)))
continue
until = m.backoff_until(now)
if until is not None:
# MAINT-25: a failed cycle waits (MAINT-13); no run is planned.
lines.append(line_cycle_backoff(inv.name, until))
continue
if not m.due(now) and (m.next_due(now) is None
or m.next_due(now) >= day1):
continue
@@ -1529,6 +1534,13 @@ def line_cycle_waits(name) -> str:
return _t("cycle_waits", name=name)
def line_cycle_backoff(name, until) -> str:
"""MAINT-25: the failed cycle waits until `until` (MAINT-13)."""
local = brussels(until)
return _t("cycle_backoff", name=name, day=local.day,
month=month_name(local))
def line_no_prices(since, now) -> str:
"""PRICE-01: no price covers now. `since` is an instant or None."""
if since is None:
@@ -1669,6 +1681,8 @@ def _samples() -> list:
("plan", run_house_why()), ("plan", run_house_why(True)),
("plan", run_house_amount()),
("plan", line_cycle_waits("Battery B")),
("plan", line_cycle_backoff("Battery B", datetime(
2026, 11, 19, 12, 0, tzinfo=timezone.utc))),
("plan", line_no_prices(None, datetime(2026, 10, 14, 9, 0,
tzinfo=timezone.utc))),
("plan", line_no_prices(datetime(2026, 10, 14, 0, 0,
+1
View File
@@ -430,6 +430,7 @@
"give": "Tomorrow: gives power at {at}, {eur} per kWh.",
"give_would": "Tomorrow: would give power at {at}, {eur} per kWh."
},
"cycle_backoff": "{name}: the monthly cycle waits until {day} {month}.",
"cycle_waits": "{name} waits its turn for the monthly cycle.",
"no_prices_yet": "No prices yet, maintenance waits.",
"no_prices_since": "No prices since {at}, maintenance waits.",
+1
View File
@@ -365,6 +365,7 @@
"no_level": "Nu geen handel op prijs: een laadniveau is onbekend."
},
"tomorrow_trade": {"grid": "Morgen: laadt om {at}, {eur} per kWh.", "grid_would": "Morgen: zou laden om {at}, {eur} per kWh.", "give": "Morgen: levert stroom om {at}, {eur} per kWh.", "give_would": "Morgen: zou stroom leveren om {at}, {eur} per kWh."},
"cycle_backoff": "{name}: de maandelijkse cyclus wacht tot {day} {month}.",
"cycle_waits": "{name} wacht zijn beurt af voor de maandelijkse cyclus.",
"no_prices_yet": "Nog geen prijzen, onderhoud wacht.",
"no_prices_since": "Geen prijzen sinds {at}, onderhoud wacht.",