Skip to content

mercedesme: car entries with no usable values survive; snapshot carries no provider data age #49

Description

@ThinkOffApp

Found during review of #48 (codexmb, confirmed by claudemm against the producer):

  1. 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.

  2. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions