Skip to content

fix(web): show charger connection state in power flow - #2051

Open
segran2 wants to merge 4 commits into
srcfl:masterfrom
segran2:fix/ev-flow-disconnected
Open

segran2 wants to merge 4 commits into
srcfl:masterfrom
segran2:fix/ev-flow-disconnected

Conversation

@segran2

@segran2 segran2 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

The power-flow bubble showed “idle” or “no data” when the car was unplugged. It now shows “not connected” from the charger’s connection state. A connected car without a power reading shows “connected · no power data”, including when control feedback reports stale power.

Validated on a live Pi running v0.165.1-beta.1. The bubble changed from “not connected” to “idle” after plugging in, then to “charging” during manual charging, with about 10.3 kW reported by the charger. The missing-power case is covered with synthetic status and control-feedback data.

All 946 web tests passed.

make verify passed after syncing the bundled driver snapshot to the release's pinned commit. Native worker execution tests were skipped because this development host has no bundled worker.

The Pi has the visually checked patch. The final missing-power regression correction was verified locally and is included here.

@miravoss26 miravoss26 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What it does: the EV power-flow bubble shows "not connected" when `ev_connected === false`, and "connected · no power data" when connected without a power reading, instead of "idle"/"no data". Also preserved through control-feedback marks.

Read: small and local to `web/`; the tests cover the unplugged case for null/0/1000 W, connected-idle unchanged, and the feedback-mark case. No security surface (no new deps, network calls or authz). Validated on a live Pi per the description.

  • nit: in `flowReadingsFromStatus` the second pass over `markedPlanets` re-derives the same disconnected/no-power states already handled when the planet is built. Fine for now, but it's two places to keep in sync.

Safe to merge from my read.

@frahlg

frahlg commented Nov 21, 2026

Copy link
Copy Markdown
Member

Thanks. We checked this in a browser against a real box, with the charger fields set by hand. "not connected" fits inside the ring. "connected · no power data" does not: the label is 148 px wide and the bubble is about 129 px wide at that line, so the text runs about 9 px past the ring on each side. Please shorten it, for example to "connected · no data", in both places in energy-flow-readings.js and in the test. The rest reads right.

Signed-off-by: Segran <goran@andersson-stehag.se>
Signed-off-by: Segran <goran@andersson-stehag.se>

@miravoss26 miravoss26 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shows "not connected" for an unplugged charger and "connected · no data" when the car is attached but power is missing, including when control feedback reports stale power. Tests cover null, 0 and 1000 W for the unplugged case and the control-feedback path.

  • Minor: ev_connected === false forces evW to 0, so an inconsistent reading (unplugged but 1000 W) is silently hidden. Probably what you want for the bubble, but worth a one-line comment so nobody 'fixes' it later.
  • The connection-state override runs in a second loop after withControlMarks, which works but splits the EV logic across two places. Fine for a patch, easy to fold in later.
  • No secrets, deps or network changes. CI green.

Safe to merge from my read.

Signed-off-by: Segran <goran@andersson-stehag.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants