OPT-36: Leftover solar counts Cheap hours and Solar first batteries before buying #229

Merged
admin merged 8 commits from OPT-36 into hotfix-0.20.1 2026-11-02 14:49:46 +01:00
Showing only changes of commit 1ac7fe98d7 - Show all commits
+7 -5
View File
@@ -44,7 +44,7 @@ sys.path.insert(0, HERE)
sys.path.insert(0, os.path.join(HERE, "tools"))
logging.disable(logging.WARNING)
from named_absence import nth # noqa: E402
from named_absence import nth, present # noqa: E402
import ux54_scenarios as S # noqa: E402
import opt11p3_replay as rp # noqa: E402
import app.main as m # noqa: E402
@@ -793,12 +793,14 @@ check("mid night: A's commands follow the levels: it charges to its level "
md["soc"][0] < 85.0 and abs(md["soc"][0] - m2["target_a"]) < 0.5)
check("mid night: B fills as before (to the ceiling)", md["soc"][1] > 94.0)
mf = R["mid_flat"]
lv_f = {mk["target_a"] for mk in mf["marks"].values()}
print(f" mid_flat: A level(s) {sorted(lv_f)}; A ends {mf['soc'][0]:.2f} %")
lv_f = [mk["target_a"] for mk in mf["marks"].values()]
lv0 = nth(lv_f, 0)
print(f" mid_flat: A level(s) {sorted(set(map(str, lv_f)))}; A ends "
f"{mf['soc'][0]:.2f} %")
check("one figure all night: A's level never moves (round 2: 55 -> 69 -> "
"41 -> 37 %), A charges to it and stops (round 2: 56 %)",
len(lv_f) == 1 and None not in lv_f
and abs(mf["soc"][0] - next(iter(lv_f))) < 0.5)
present(lv0) and lv0 is not None and len(set(lv_f)) == 1
and abs(mf["soc"][0] - lv0) < 0.5)
fd = R["f1_dark_b"]
dk = fd["marks"]
held = [dk[h]["target_a"] for h in dk if "05:15" <= h < "07:00"]