diff --git a/server/data_model.py b/server/data_model.py index 10f20d4..d2e750f 100644 --- a/server/data_model.py +++ b/server/data_model.py @@ -265,6 +265,11 @@ def apply_procedural(record: dict) -> dict: """ proc: dict = {} + range_at_soc = _get(record, "measurements", "rangeStatus", "totalRange", "value") + soc = _get(record, "charging", "batteryStatus", "currentSOC", "value") + if range_at_soc is not None and soc: + proc["range_at_100"] = _phys(round(100 * float(range_at_soc) / float(soc), 1), "km") + # ── add computed fields here ────────────────────────────────────────── # Use _get(record, "domain", "statusObject", "field", "value") to # safely read any nested value. Always use {"value": ..., "unit": ...}