UX-54 scenarios keep the gate they were written for (cycle cost 0.15 with a forecast)

With master merged in (TARIFF-24), a forecast replaces the 1.5x widening, so
the shipped cost 0.10 is now the whole gap with a forecast. test_ux54.py's
modes-on scenarios were written for 0.15 and 21 of its checks failed on
release/1.0 + master (they pass on release/1.0 alone). They now set the cost
to 0.15 where they have a forecast: the same gate as before. Scenarios with no
forecast (nofc, stale) and modes off keep 0.10, widened as before.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
glenn schrooyen
2026-10-29 21:06:09 +01:00
co-authored by Claude
parent 7433786a37
commit 665653517c
@@ -247,6 +247,12 @@ def make(name, now, *, soc=(55.0, 40.0), modes=("solar_first",
tomorrow = False
if name == "sunny":
sun_today, sun_tomorrow = 40.0, 40.0
if name not in ("nofc", "off", "stale") and \
opts.get("battery_modes_enabled"):
# TARIFF-24: with a forecast the gap needed is the cycle cost, not
# 1.5 x it. These scenarios were written for the old gate (0.15 at
# the shipped 0.10), so they keep it: the cost is 0.15.
opts["cycle_cost_threshold_eur"] = 0.15
c = Controller(opts, Hass(), Store(), Pub(), stop=asyncio.Event())
c.auto = True
for i, inv in enumerate(c.inverters):