Setup-Menü: Wertvorschau, Unavailable-Warnung, Duplikat-Check, Reset, Neustart-Hinweis

Fünf Erweiterungen des bestehenden Setup-Popups: Live-Wert neben jedem
Such-Kandidaten, Warnhinweis bei unavailable/unknown/fehlender Entität,
Duplikat-Check mit Bestätigung vor dem Speichern, Zurücksetzen-Button je
Feld (Standardwerte-Snapshot in entitaeten.py, vor jedem Override
genommen), und ein bestätigter "Jetzt neu starten"-Knopf nach dem
Speichern, falls sich eines der drei trigger-gebundenen Felder geändert
hat (neuer Service audi_dashboard_neustart). Im Docker-Testcontainer
Feld für Feld verifiziert.
This commit is contained in:
2026-08-12 18:48:35 +02:00
parent 3548f773c9
commit d5562c71ef
6 changed files with 173 additions and 18 deletions
+35 -1
View File
@@ -1,6 +1,6 @@
# AGENTS.md — Project state, review findings, open items, and working rules
**Last updated: 2026-08-12**. This file is the entry point for every new agent
**Last updated: 2026-08-12** (Setup-menu polish batch). This file is the entry point for every new agent
session: what this repo is, what is finished, what is missing, and how to work here. Detail lives in
the linked documents — this file points, it does not duplicate.
@@ -49,6 +49,13 @@ toward caution over speed — for trivial tasks, use judgment.
- Conflicting instructions get picked arbitrarily — when updating, **remove** superseded rules
rather than stacking corrections.
- Verify loading with `/context` (file must appear under **Memory files**); edit via `/memory`.
- **This file (plus the session's task list) is the source of truth for what's done — not a leftover
plan-mode file.** A `~/.claude/plans/*.md` file surfaced by the system as "not yet complete" can be
stale: plan files aren't marked complete when their work finishes. Before claiming a feature is
unbuilt (e.g. "the Setup menu isn't implemented yet"), check the `[x]`/`[ ]` items below and/or the
task list — trust those over an old plan file's own claim about its status. (Caused a real mistake
2026-08-12: told the user the Setup menu wasn't built yet, when it had shipped hours earlier in
the same project — see the "Setup menu" `[x]` entry further down.)
---
@@ -365,6 +372,33 @@ capacitor/iframe/browser (`umgebung.ts`), types + entity table (`types.ts`), fac
`update.ps1`) plus a short `ANLEITUNG.md` checklist for copying to a fresh HA instance;
`INSTALL.md` stays the authoritative, detailed reference. Regenerate on demand, don't keep it
permanently in sync — it's a deployment snapshot, not a second source of truth.
- [x] Setup-menu polish: 5 additions on top of the existing Setup popup — done 2026-08-12.
Backend (`pyscript/modules/entitaeten.py`): a `_STANDARDWERTE` snapshot taken at module-load
time (before `overrides_anwenden()` ever runs), exposed via `aktueller_stand()` as
`standardwerte` — needed because `setattr()` on the live `einstellungen` module is permanent
for the process, so "reset to default" has to write the original value back explicitly rather
than just omitting the override. New service `audi_dashboard_neustart` (`frontend_api.py`)
wrapping `homeassistant.restart()`, called only from an explicit user-confirmed button, never
automatically. Frontend (`audi-dashboard-app.js`): (1) live current-value preview next to each
candidate in the search dropdown (`entitaetZeilenMarkup`, reads `HASS.states[e.id].state`);
(2) inline warning under a field if its currently assigned entity is `unavailable`/`unknown`/
missing (`entitaetStatusWarnung`); (3) duplicate-assignment check on save
(`setupDuplikate`) — blocks with a confirm-sheet ("trotzdem speichern?") rather than silently
allowing the same entity in two roles; (4) per-field reset button (only shown when the current
value differs from `standardwerte`), reverts to the built-in default; (5) after saving, if any
of the 3 trigger-bound fields actually changed (`setupGeaenderteTriggerFelder`, compares
against a snapshot taken when the popup opened), a confirm-sheet offers "Jetzt neu starten"
calling the new service. Verified live in `audi_ha_test`: value preview and unavailable-warning
confirmed correct (`ZUENDUNG_SENSOR`'s configured entity genuinely doesn't exist in this test
container → "Entität nicht gefunden." shown as designed); duplicate-check correctly caught both
a deliberately-forced KM/TANK collision and pre-existing door/window/lock auto-suggestion
collisions (a real side effect of this container's limited matching entities, not a bug);
reset button appeared/disappeared correctly as values diverged from/matched the default;
save round-tripped through the real service into `data/entitaeten.json` (byte-inspected) and
into the published `pyscript.audi_dashboard_fahrzeugstatus` state; restart-needed sheet named
exactly the changed trigger-bound field(s) and no others. Did not actually trigger a restart
during verification (would have restarted the shared test container) — the service call itself
was left unexercised beyond confirming it registers without error at pyscript load time.
- [ ] Fix remaining documentation drift (statistics claim, README gaps, obsolete TODO comment) —
text-only changes; INSTALL.md's WLAN/TommiG1 drift and stale variable names were fixed
2026-08-12 (see section B)