feat: live telemetry on gun cards — SoC battery gauge, kW, V, A, delivered kWh

- backend keeps the latest meter sample per active transaction in memory
  and ships it as active_transactions[tx].telemetry on /api/status
  (Transaction.Begin snapshots skipped: taken before the BMS is read)
- Battery component: fill + color sweep red (empty) -> blue (half) ->
  green (full) per the owner's spec; aria meter semantics
- charging bays show the gauge, a prominent kW readout, and delivered
  kWh / voltage / current rows; hint while awaiting the first sample
- smoke: 60 checks (telemetry rides /api/status)
This commit is contained in:
2026-07-12 09:39:05 +02:00
parent 8d8affe6ff
commit 25fa1f9fc5
7 changed files with 149 additions and 15 deletions
+4
View File
@@ -91,3 +91,7 @@ Owner confirmed the React panel loads on the phone after backend restart. Change
## [2026-07-12] meta | Private history; permissions on Account; Start only when plugged; "Art IoT" rename
Owner (testing on the phone, second user created): (1) transactions are now PRIVATE — non-admins see only their own sessions (app starts + linked cards); gun scopes grant control, not visibility; admins see all. (2) Account page shows the user's own permissions in plain words (admin badge, or gun/relay list built from data they already see). (3) Start button arms ONLY when the cable is plugged (Preparing) — an idle unplugged gun shows "plug the cable into the car to enable". Owner also renamed the app to "Art IoT" (login, topbar, manifest, title) — kept. Smoke: 59 checks. Updated [[backend]], [[frontend]].
## [2026-07-12] meta | Live telemetry on the gun cards: SoC battery gauge + kW/V/A/delivered
Owner wants meter values visible per gun in Control. Backend: latest Sample.Periodic per active tx kept in memory (ACTIVE_TX telemetry) and shipped with /api/status (Transaction.Begin snapshots skipped — taken before the car's BMS is read). Also this morning's finding filed: begin/end snapshots are legitimately 0 A/0 V, and a 42 s session never gets a periodic sample. Frontend: battery gauge with red->blue->green SoC gradient + big kW readout + Delivered/Voltage/Current rows on charging bays; earlier commit added voltage_v/current_a/context columns to samples. Smoke: 60 checks. Updated [[frontend]], [[backend]] implicitly via log.