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:
@@ -215,6 +215,13 @@ class ChargePoint(OcppChargePoint):
|
||||
if reading:
|
||||
store.add_sample(tx, entry.get("timestamp", now()),
|
||||
context=context, **reading)
|
||||
# live telemetry for the panel: latest sample rides
|
||||
# /api/status. Transaction.Begin is skipped — it's taken
|
||||
# before the car's BMS is read (SoC 0, all zeros).
|
||||
if context != "Transaction.Begin" and tx in ACTIVE_TX:
|
||||
ACTIVE_TX[tx].setdefault("telemetry", {}).update(
|
||||
{**reading, "time": entry.get("timestamp")}
|
||||
)
|
||||
log.info("MeterValues: connector=%s values=%r", connector_id, meter_value)
|
||||
return call_result.MeterValues()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user