OPT-17 review: title the forecast row on Home; test the hint and blank rows
The new status row's id `solar_forecast` had no Home title, so Home showed it under the fallback "Inverter connection". Add "Solar forecast" / "Zonneprognose" to ui_text, and checks for the title, the tomorrow-gap hint and blank list rows (review mutations R7, R9, R14 now killed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bdqr7PiaHcBnzPituu2yTC
This commit is contained in:
@@ -28,7 +28,8 @@ sys.path.insert(0, os.path.join(HERE, "tools"))
|
||||
logging.disable(logging.WARNING)
|
||||
|
||||
import opt11p3_replay as rp # noqa: E402
|
||||
from app import dayplan, messages, solarfc, validate # noqa: E402
|
||||
from app import (dayplan, homeview, messages, solarfc, uitext, # noqa: E402
|
||||
validate)
|
||||
|
||||
fails = []
|
||||
|
||||
@@ -240,6 +241,9 @@ for one, many in (solarfc.TODAY_KEYS, solarfc.TOMORROW_KEYS):
|
||||
not F({many: ["sensor.b", "sensor.c"]}) and not F({one: "sensor.a"})
|
||||
and not F({one: "sensor.a", many: []})
|
||||
and not F({one: "", many: ["sensor.b"]}))
|
||||
check(f"...blank rows in {many} are ignored, alone or beside {one}",
|
||||
not F({many: ["", None, "sensor.b"]})
|
||||
and not F({one: "sensor.a", many: ["", None]}))
|
||||
p = F({many: ["sensor.b", "number.x"]})
|
||||
check(f"...an entry in {many} that is not a sensor is refused",
|
||||
len(p) == 1 and "only sensors" in p[0] and "number.x" in p[0])
|
||||
@@ -454,6 +458,13 @@ check("a tomorrow member down: today is used, tomorrow is not, and the row "
|
||||
"Solar forecast for tomorrow: not used, source 2 of 2 has no "
|
||||
"reading"]
|
||||
and len(fc_events(c)) == 1 and "sensor.tom_down" in fc_events(c)[0])
|
||||
check("...and the page hint says tomorrow's forecast is not used",
|
||||
(c.hint or "").endswith(messages.hint("forecast_no_tomorrow")))
|
||||
check("...and Home titles the row as the solar forecast, in EN and NL",
|
||||
[a["title"] for a in homeview.attention(fc_rows(c))]
|
||||
== ["Solar forecast"]
|
||||
and uitext.words("nl")["home_words"]["attn"]["solar_forecast"]
|
||||
== "Zonneprognose")
|
||||
first = CALLS[:8]
|
||||
check("every member of both days is read in one gather (all four start "
|
||||
"before any ends)",
|
||||
|
||||
Reference in New Issue
Block a user