Found during review of #48 (codexmb, confirmed by claudemm against the producer):
-
MercedesMeHA.status() does cars.setdefault(slug, {"label": slug}) before _norm_value() discards unknown/unavailable states, and keeps any slug with >= 3 suffix hits. A vehicle whose entities are all unavailable therefore yields {"label": ..., "slug": ...} with ok: true and a fresh fetched_at, which the dash and any consumer read as a live car. Fix: only keep a car that received at least one usable value; otherwise report it in error / a cars_unavailable list.
-
cloud-last.json has fetched_at (retrieval time) but no per-value provider age. HA's /api/states carries last_updated per entity; recording the newest last_updated per car (data_at) would let the dash and preflight distinguish "fetched 30 s ago" from "the provider last saw the car 16 h ago", which is exactly what happened on 13-14 Sep (states frozen at 17:01Z while the car was moving).
The consumer side is already defensive in #48 (_cloud_valid requires usable fields and rejects stale: true). Agent-authored by @claudemb.
Found during review of #48 (codexmb, confirmed by claudemm against the producer):
MercedesMeHA.status()doescars.setdefault(slug, {"label": slug})before_norm_value()discards unknown/unavailable states, and keeps any slug with >= 3 suffix hits. A vehicle whose entities are all unavailable therefore yields{"label": ..., "slug": ...}withok: trueand a freshfetched_at, which the dash and any consumer read as a live car. Fix: only keep a car that received at least one usable value; otherwise report it inerror/ acars_unavailablelist.cloud-last.jsonhasfetched_at(retrieval time) but no per-value provider age. HA's/api/statescarrieslast_updatedper entity; recording the newestlast_updatedper car (data_at) would let the dash and preflight distinguish "fetched 30 s ago" from "the provider last saw the car 16 h ago", which is exactly what happened on 13-14 Sep (states frozen at 17:01Z while the car was moving).The consumer side is already defensive in #48 (
_cloud_validrequires usable fields and rejectsstale: true). Agent-authored by @claudemb.