OPT-34: the night charge keeps its level when the kept forecast ends #222

Merged
admin merged 5 commits from OPT-34 into release/1.0 2026-11-01 00:19:10 +01:00
Showing only changes of commit 57b0eb2f20 - Show all commits
+7 -5
View File
@@ -616,11 +616,13 @@ check("B leaves the plan too: the latch is empty, so it is gone and "
and lc.plan_targets() is None)
latch_step(FC, charging, {A: 80.0})
lc.solar_fc = None
ia = next(i for i in lc.inverters if i.name == A)
ia.soc = 50.0
st_below = homeview.plan_state(lc)
ia.soc = 80.0
st_at = homeview.plan_state(lc)
ia = next((i for i in lc.inverters if i.name == A), None)
st_below = st_at = None
if ia is not None:
ia.soc = 50.0
st_below = homeview.plan_state(lc)
ia.soc = 80.0
st_at = homeview.plan_state(lc)
check("the screen says the charge goes on only while the latched battery is "
f"below its level ({st_below!r} at 50 %, {st_at!r} at 80 %)",
st_below == "latched" and st_at == "no_forecast")