Repository navigation
Conversation
Add the nissanconnect vehicle module with validated battery, range and automatic odometer retrieval through the European MyNISSAN service. Reuse tokens, honor request backoff and expose private diagnostics with request counts without changing shared charging policy. Include an isolated connection-test worker, synthetic tests and documentation of service-access, privacy and tested-model limits. The companion settings contribution owns the form and PHP endpoints.
|
Danke für die Arbeit, aber das ist für ein Fahrzeug-Modul deutlich zu viel Umfang (2570 Zeilen/22 Dateien hier, 2085 Zeilen/16 Dateien im UI-PR). Zum Vergleich lohnt sich ein Blick auf andere Fahrzeug-Module hier im Repo, z.B. Core-Seite:
UI-Seite (openWB/openwb-ui-settings#1123):
Insgesamt: bitte auf die Größenordnung der bestehenden Module einpendeln (ein paar hundert Zeilen Code, kurze PR-Beschreibung) statt eigener Doku-/Test-/Tooling-Infrastruktur pro Modul. Das macht es fürs Team auch deutlich leichter, das sinnvoll zu reviewen. |
Use shared HTTP sessions and dataclasses in five flat module files. Keep SoC, measurement time, range and odometer; Core owns polling. Remove custom backoff, counters, connection tests, CLI and extra docs. Retain inline attribution and scoped filtering of sensitive HTTP logs. Validate with 48 focused API tests and a successful Leaf ZE1 SoC trial.
|
Valider Einwand. Ich fand die Einstellungsseite zwar schick, komfortabel und sinnvoll, aber mit der nun überarbeiteten Version ist der Code, zugegeben, schon deutlich überschaubarer. |
The existing Leaf integration uses a different Nissan service. This adds
nissanconnectfor European MyNISSAN accounts, exposing cached battery SoC, original measurement time, and range and odometer when available through openWB's existing vehicle interfaces. The display name is Nissan – MyNISSAN EU (experimental). Only Leaf ZE1 has positive practical test reports; other models are unverified.Odometer retrieval is automatic after successful battery retrieval, subject to retry pauses and the request budget; there is no separate user setting. A missing, invalid or failed odometer result does not invalidate valid SoC. Nissan supplies no odometer measurement time, so neither battery time nor retrieval time replaces it.
The standard-library client reuses in-memory tokens, honors backoff/rate limits and validates measurements. It sends no wakeup or charging commands. Existing Core scheduling, fallback and charge policy remain unchanged, including its zero-SoC error behavior. Diagnostics distinguish request and measurement times and exclude account identifiers and tokens; battery values/times remain private.
Scheduled-query diagnostics include HTTP request totals for the rolling last 24 hours, since local midnight and since observation started, with the start timestamp and coverage flags. History is held only in the configured vehicle module's memory and resets on restart/recreation. Separate settings tests and other vehicle instances are not combined. No new storage, MQTT topic or rate-limit policy is added.
The companion settings contribution provides a form and passive unsaved connection test. This patch owns its stdin-only Python worker; settings owns and builds both PHP endpoints. The test does not save configuration or publish battery values to charging control. Internal source, tests, tools and documentation are separated; native module and worker entry paths remain.
Validation
c477f77on 2026-10-10.These are local affected-area checks. The complete Core suite could not load its shared Windows fixtures because the existing
ocppdependency is absent and a broker error path requires/proc/cpuinfo. The full Nissan-module run under Linux reached 144 passing cases but three adapter fixtures lackedpaho; the focused 29-case Linux run passes, and the adapter cases pass in the prepared Python 3.9 Windows environment. Normal Linux CI remains needed; no dependency or shared Core workaround is included. Hosted CI had not run before submission.Integration and review boundaries
Review together with the companion settings PR. It delivers the endpoints from
public/modules/vehiclesthrough the normal settings build, following the existing BMW/Porsche layout. No full compiled UI archive, dependency upgrade or shared Core/theme change is included.Specific permission for this unofficial app-API access has not been established. The source license does not settle Nissan service access. The module's
docs/user-information.mdexplains this limit, ordinary credential storage, private logs/backups and the absence of fresh-vehicle guarantees. NOTICE retains source attribution.Inherited Core debug-log redaction can leave account identifiers or password fragments visible. This remains a maintainer follow-up; the module excludes credentials from its own diagnostics and does not patch shared logging policy. The notices are not a security fix or a claim of GDPR compliance. Maintainer acceptance of unofficial service access and these boundaries remains a review decision.