From 6b35de458d7f0ce424feb91ede0f488bc3479bcb Mon Sep 17 00:00:00 2001 From: Tobi G Date: Fri, 28 Aug 2026 12:01:10 +0200 Subject: [PATCH] Fahrgestellnummer: expliziter "automatisch"-Schalter statt Nur-wenn-leer-Heuristik MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Neues Profilfeld fahrzeug.fin_automatisch (Standard: an). - identitaet.py: bei "aus" läuft die Ableitung (samt Mehrfach-Sensor-Abgleich) gar nicht erst; bei "an" überschreibt der abgeleitete Wert auch einen vorher von Hand eingetragenen - der Schalter selbst entscheidet jetzt, statt aus einem leeren Feld zu raten. - dienste.py: profil_schreiben löst die Ableitung jetzt auch aus, damit das Umschalten des Schalters selbst sofort wirkt. - Panel: Schalter "automatisch" zwischen Label und Textfeld in der Fahrgestellnummer-Zeile, Feld wird bei "an" deaktiviert. Co-Authored-By: Claude Sonnet 5 --- AGENTS.md | 38 ++++++++++++++++ custom_components/audi_dashboard/dienste.py | 8 +++- .../frontend/audi-dashboard-app.js | 15 ++++++- .../frontend/audi-dashboard.css | 4 ++ .../audi_dashboard/identitaet.py | 43 +++++++++++++------ .../audi_dashboard/manifest.json | 2 +- .../vorlage/fahrzeugprofil.json | 1 + 7 files changed, 94 insertions(+), 17 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index e4f4e8d..723f1f6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4444,6 +4444,44 @@ needed either - the "Fahrgestellnummer (FIN)" field in "Fahrzeug einrichten" alr profile field, so it now simply arrives pre-filled instead of blank, and stays fully editable/correctable by hand same as before. +**Same-day follow-up (2026.8.28.16): an explicit "automatisch" switch, per owner request** ("make a Slider +next to 'Fahrgestellnummer (FIN)' ... automatisch turns on/off the auto-grab VIN from Sensor-Database ... +and also deactivates the sanity-check if VIN matches between sensors"). The original design's "only fill an +empty field, never touch a set one" heuristic is gone - replaced by an explicit, user-visible mode: + +- New profile field `fahrzeug.fin_automatisch` (bool, default `true` - added to `vorlage/fahrzeugprofil.json` + and defaulted in `profilZuCar()` via `!== false` for profiles from before this field existed). +- `identitaet.fin_ableiten_und_uebernehmen()` rewritten: returns immediately if `fin_automatisch` is `false` + - **before** even calling `fin_kandidaten_ermitteln()`, so the multi-sensor comparison/mismatch-warning + never runs either, exactly as asked. When `true`, the derived value is now treated as authoritative and + **overwrites** whatever is currently in `fin` (including a previously hand-typed value) whenever a single + clear candidate is found - this is the whole point of an explicit toggle: no more guessing from emptiness, + the human's chosen mode decides. A `fin == kandidat` check avoids a pointless rewrite/republish when + nothing actually changed. +- Panel (`vEinst()`): a `