Merge release/1.0 (SAFETY-78, #154) into opt11-p4-solar-forecast
checks / unit (pull_request) Successful in 23m54s
infra-pin / fresh (pull_request) Successful in 1s

Conflicts: modetrade.decide() takes both the day plan (targets) and
SAFETY-78's draining flag; the Why line keeps SAFETY-78's other_cycle
ahead of the plan's word (test added).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
glenn schrooyen
2026-09-29 22:37:09 +02:00
co-authored by Claude Opus 5.5
18 changed files with 743 additions and 93 deletions
+12 -1
View File
@@ -93,7 +93,8 @@ WANT = {
"off": ("solar_first", "off"),
"off_peak": ("peak", "off_peak"),
"refusal": ("refuses_give", "other_refuses"),
"maint": ("cycle_mode", "leftover"),
# SAFETY-78: the other battery says why it does not charge.
"maint": ("cycle_mode", "other_cycle"),
}
# ============================================================================ #
@@ -326,6 +327,16 @@ _cases = [
"no_forecast"),
(dict(mode=packmode.LEFTOVER_SOLAR, role="charge", day="tops_up"),
"grid_charge"),
# SAFETY-78: another battery drains for its monthly cycle.
(dict(other_cycle="A"), "other_cycle"),
(dict(other_cycle="A", modes_on=False, giving=True), "other_cycle"),
(dict(other_cycle="A", mode=packmode.CHEAP_HOURS, role="charge"),
"other_cycle"),
(dict(other_cycle="A", peak=True), "peak"),
(dict(other_cycle="A", refused=-1), "refuses_charge"),
(dict(other_cycle="A", off=True), "off"),
(dict(other_cycle="A", mode=packmode.LEFTOVER_SOLAR, role="hold",
day="tops_up"), "other_cycle"),
]
_wrong = [(kw, want, why(**kw)) for kw, want in _cases if why(**kw) != want]
print(f" {_wrong}")