UX-08 2c: short refusals, error texts and option texts
Validator refusals name the setting by its label and key, say what is wrong and what to change, and keep the rejected value and limit. Option names and descriptions are short in en and nl; citations moved to DOCS "For installers" and the test_translations citation check now pins the instruction on the tab and the record in DOCS. No rule, key, schema, default or exit code changed. Allowlist 167 -> 43 (log lines only). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LyR88rXETvwhTgx6yHE39p
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e1d0970b23
commit
2c516a032c
@@ -798,3 +798,51 @@ def samples() -> list:
|
||||
meter_frozen(600),
|
||||
meter_frozen(90),
|
||||
]
|
||||
|
||||
|
||||
# --- refusals (UX-08 phase 2c) --------------------------------------------------
|
||||
# A refusal names a setting by its label on the Configuration tab and then by its
|
||||
# key, because an installer editing in YAML needs the key. The label is the
|
||||
# en.yaml name without its group prefix and unit; test_messages.py checks that.
|
||||
LABELS = {
|
||||
"setpoint_entity": "Inverter setpoint entity",
|
||||
"max_w": "Inverter rating",
|
||||
"bms_soc_floor": "Battery cut-out level",
|
||||
"capacity_kwh": "Usable battery capacity",
|
||||
"inverters": "Inverter list",
|
||||
"name": "Name",
|
||||
"meter_source": "Where the meter reading comes from",
|
||||
"meter_phases": "Number of phases",
|
||||
"p1_host": "HomeWizard P1 address",
|
||||
"meter_poll_s": "Time between meter reads",
|
||||
"meter_max_age_s": "Reading too old after",
|
||||
"meter_mqtt_topic": "MQTT topic",
|
||||
"p1_import_entity": "Grid import entity",
|
||||
"p1_export_entity": "Grid export entity",
|
||||
"p1_net_entity": "Signed net power entity",
|
||||
"p1_phase_net_entities": "Net entities per phase",
|
||||
"peak_soc_floor": "Peak reserve",
|
||||
"price_provider": "Dynamic price source",
|
||||
"price_taxes_eur_kwh": "Distribution, levies and VAT",
|
||||
"static_profile": "Fixed or day/night tariff",
|
||||
"price_taxes_profile": "Day/night levies and VAT",
|
||||
"price_formula": "Your own tariff formula",
|
||||
"price_export_formula": "Your own injection formula",
|
||||
"price_csv_path": "Price CSV file",
|
||||
"price_now_entity": "Current price entity",
|
||||
"price_avg_entity": "Average price entity",
|
||||
"arbitrage_enabled": "Trade on the price spread",
|
||||
"cycle_cost_threshold_eur": "Battery cycle cost",
|
||||
"arbitrage_soc_floor": "Trading keeps at least",
|
||||
"arbitrage_soc_ceiling": "Trading charges at most",
|
||||
"maintenance_charge_w": "Recharge rate",
|
||||
"sign_disagree_w": "Wrong-direction threshold",
|
||||
"unit_sign_disagree_w": "Per-inverter wrong-direction threshold",
|
||||
"slew_w": "Largest change per cycle",
|
||||
"shadow_mode": "Shadow mode",
|
||||
}
|
||||
|
||||
|
||||
def setting(key: str, unit: str = "") -> str:
|
||||
"""`max_w` -> `“Inverter rating” (max_w)`, plus ` for inverter-b` in a list."""
|
||||
return f"“{LABELS[key]}” ({key})" + (f" for {unit}" if unit else "")
|
||||
|
||||
Reference in New Issue
Block a user