v0.6.14 — Primary range distance units
Summary
Fixes hardcoded km on the value_of_the_primary_range electric-range sensor (Cupra/MEB datasets that expose a generic portal value field). Units are now resolved from companion portal fields — important for UK vehicles reporting range in miles.
Distance unit resolution
value_of_the_primary_range(curated + raw diagnostic) inherits units via fallback chain:range.unit→mileage.unit→battery_state_report.cruising_ranges.*.unit→ defaultkm.- New helpers:
resolve_distance_unit_from_companion_fields(),resolve_primary_range_unit(), andCuratedSensor.unit_fieldsfor ordered fallbacks. mileage.value/range.valuebehaviour unchanged (still use their dedicated*.unitfields).
Bug fix
- Raw diagnostic sensors no longer crash entity setup with
AttributeErrorwhennative_unit_of_measurementwas never set (e.g. enum/string raw fields).
Tests
- Offline coverage for primary-range unit resolution (mileage.unit, range.unit, cruising_ranges fallback).
Upgrade
Reload the integration once after updating (Settings → Devices & services → VW Group EU Data Act → Reload).