Merge origin/master (0.20.1) into release/1.0
checks / unit (pull_request) Successful in 32m4s
infra-pin / fresh (pull_request) Successful in 2s

Brings OPT-36 (#229) and TEST-37 (#231) onto release/1.0, which keeps
SAFETY-128 (#228). No textual conflicts. CHANGELOG: the SAFETY-128 entry
moved out of the released 0.20.0 section into "Not in a release yet" above
## 0.20.1; the 0.20.0 and 0.20.1 sections are identical to master.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
glenn schrooyen
2026-11-05 18:34:34 +01:00
co-authored by Claude
15 changed files with 1292 additions and 69 deletions
+6 -2
View File
@@ -206,7 +206,8 @@ def measure(c, now, peak_w):
def make(name, now, *, soc=(55.0, 40.0), modes=("solar_first",
"solar_first")):
"solar_first"),
evening=None):
"""The controller of scenario `name` at `now` (UTC), its cycle run once."""
assert name in SCENARIOS, name
opts = dict(BASE)
@@ -271,7 +272,10 @@ def make(name, now, *, soc=(55.0, 40.0), modes=("solar_first",
members=members, tomorrow=tomorrow)
c.solar_fc_why = None
if name != "learning":
c.house_profile = profile(now)
# OPT-36: `evening` (W) makes the dear hours' use larger than
# what a Cheap hours battery covers, so Leftover solar still buys.
c.house_profile = profile(now) if evening is None \
else profile(now, evening=evening)
if name in ("owner", "dynamic", "sunny", "periods", "learning",
"notomorrow", "cycle"):
measure(c, now, 7000.0 if name != "dynamic" else 2500.0)