SMA-2 round 2: keep the driver keys out of the schema, translations and labels
Owner decision 2026-11-07: clients see nothing new until SMA-4. config.yaml, translations, labels and the page layout are back to 23ff9d0's. The validation of the keys stays for callers that skip the schema. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
0b20f53cf8
commit
c015230452
@@ -30,19 +30,26 @@ one unit named twice is the SAFETY-28 refusal. The census still counts every
|
||||
with 23ff9d0 on 349 option shapes is a test). The driver binds its Home
|
||||
Assistant on first use by the Controller, so a unit added later is wired too.
|
||||
|
||||
**Schema.** The brief says "`setpoint_entity` becomes optional" (SMA-2, "Schema per
|
||||
inverter entry"; SMA-9 section 1.1): it is the GoodWe driver's own key, so a
|
||||
driver reached by host and port has none. `setpoint_entity` is optional per entry
|
||||
in config.yaml; rule 9(d) still refuses a GoodWe entry without it, with the same
|
||||
sentence (`test_sma2_driver.py` part 6), beside `driver` (only `goodwe_esphome`),
|
||||
`host`, `port`, `unit_id`, `maintenance`. The last four are checked for shape
|
||||
and not read. The Supervisor shape probe was re-run (section K).
|
||||
**Schema, and why the new keys are not in it.** The brief asks for
|
||||
`driver`, `host`, `port`, `unit_id`, `maintenance` per entry and for
|
||||
`setpoint_entity` to become optional. Owner decision 2026-11-07: clients see
|
||||
nothing new until SMA-4/SMA-7 use the keys. The Supervisor form shows every
|
||||
schema key (and marks required ones), and a nested entry with a key the schema
|
||||
lacks has that key silently dropped (measured, shape probe section K), so the
|
||||
only way to hide them is to keep them out of config.yaml. So for now config.yaml, the
|
||||
translations and the labels are exactly 23ff9d0's, and `setpoint_entity` stays
|
||||
required there: until a driver without one is selectable, no entry can lack it.
|
||||
The code underneath is the brief's: the driver defaults to `goodwe_esphome`,
|
||||
rule 9(d) is per driver (a GoodWe entry without a setpoint entity is refused,
|
||||
same sentence), and rule 9(h) checks `driver`, `host`, `port`, `unit_id`,
|
||||
`maintenance` when a caller that skips the schema (the panel's save path,
|
||||
sim/inject, the checks) supplies them; those sentences name the key, having no
|
||||
label. When SMA-4 needs them: add them to the schema as optional with
|
||||
translations, make `setpoint_entity` `str?`, and add them to `uilayout` as card
|
||||
fields or a hidden list.
|
||||
|
||||
**Checked against 23ff9d0:** replay digests and a log of every Home Assistant
|
||||
call are byte-identical at N=1 and N=2; the TEL-07 announce diff is 0/0/0; a
|
||||
fake driver beside a GoodWe unit allocates, grades, drops and publishes per
|
||||
unit; a call site that goes round the seam is caught.
|
||||
|
||||
**Per-entry keys the page does not draw** are listed in `uilayout.ROSTER_HIDDEN`;
|
||||
test_uilayout and test_sma2_driver fail for a key that is neither a card field
|
||||
nor hidden, and a save through the page keeps them (a test).
|
||||
|
||||
Reference in New Issue
Block a user