Repository navigation
feat: EV driver UI + lifecycle controls + creds visibility - #73
Conversation
Gave the Easee (and future EV) drivers a first-class spot in the dashboard
and fixed the silent password-reload bug that left stale credentials in
memory after a config change.
Backend
- drivers/easee_cloud.lua: emit op_mode, reason_no_current, is_online,
cable_locked, max_a, phases in the structured ev payload, plus
ev_dynamic_current_a / ev_temp_c as diagnostic metrics
- internal/telemetry (unchanged) already preserves the raw emit JSON;
internal/api/api.go surfaces ev_w / ev_connected / ev_charging /
ev_session_wh / ev_op_mode / ev_reason_no_current / ev_is_online /
ev_cable_locked / ev_max_a / ev_phases per driver in /api/status
- /api/status: new top-level ev_credentials_saved bool (reads state.db
so UI can tell "stored" from "blanked by MaskSecrets")
- /api/status: configured-but-not-running drivers now surface as
not_running so the UI can offer Restart instead of hiding them
Driver lifecycle
- config.Driver gains Disabled (yaml) + HasPassword (json-only)
- main.go: skip Disabled drivers at startup
- drivers.Registry: new Restart(ctx, cfg) + RestartByName helpers
- drivers.Reload: filter Disabled (treats them like removed)
- drivers.sameDriverConfig now compares Config map + Lua path + Disabled
— THE fix for "new password saved but driver still fails auth"; the
diff was silently saying "nothing changed" so Reload never restarted
the driver, leaving the stale creds in memory
- new endpoints: POST /api/drivers/{name}/{restart,disable,enable}
(persist Disabled to yaml + apply via Reload)
UI
- web/app.js renderDrivers: EV branch shows State (mapped from op_mode),
Power, Session kWh, Max current, Reason (labelled), Cable warn,
Cloud offline warn. PV/battery/meter-rows skipped for EV drivers.
- Restart / Disable / Enable buttons on every driver card. Disabled
driver cards render greyed out; spawn-failed (not_running) cards
get an amber border + hint to check credentials.
- web/settings.js: per-driver cloud-credentials block now shows a
"Saved/Not saved" badge next to the password label and a
"•••••••• (leave empty to keep)" placeholder so the operator can
tell at a glance whether a password is on disk
- web/settings.js: protocol label shows "http" for cloud drivers
instead of "?"
- web/settings.js: EV Charger tab also gets the creds-saved badge,
driven by /api/status.ev_credentials_saved
- web/models.js: expanding the inline Model panel now re-renders
the panel in place from cached data instead of waiting up to 3 s
for the next /api/status poll
- web/style.css: creds-badge (saved/missing), driver-card-disabled,
driver-card-warn
Config / security
- config.MaskSecrets: sets drivers[i].HasPassword=true before blanking
the password value so the UI can render the badge without seeing
the real secret
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Protocol-specific knowledge (chargerOpMode int → "charging"/"completed"/… and reasonForNoCurrent int → human text) belongs next to the protocol, not scattered across the frontend. Drivers now emit pre-rendered labels alongside the raw codes. - drivers/easee_cloud.lua: OP_MODE_LABELS + REASON_LABELS tables; emit state_label + reason_no_current_label as strings in the ev payload. Raw codes still emitted so consumers can filter on them. - internal/api/api.go: surface ev_state_label + ev_reason_no_current_label in the per-driver status block. - web/app.js: drop evOpModeLabel() + evReasonLabel() — the card now reads d.ev_state_label and d.ev_reason_no_current_label verbatim. Net: -55 lines of Easee-specific JS, future EV drivers can plug in without touching the UI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.6 <[email protected]>
## [0.6.0](v0.5.2...v0.6.0) (2026-04-16) ### Features * EV driver UI + lifecycle controls + creds visibility ([#73](#73)) ([52a482a](52a482a)) ### Bug Fixes * 3 P1 + 1 P2 from Codex + UI cleanup ([48e0d28](48e0d28)) ### UI * move EV credentials to Devices tab, remove EV Charger tab ([7cd2d9f](7cd2d9f))
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c13238fe4f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if _, ok := drivers[dc.Name]; ok { | ||
| continue | ||
| } |
There was a problem hiding this comment.
Honor disabled config even when health entry exists
handleStatus builds drivers from Tel.AllHealth() first, then skips config-derived state when a name is already present. Because disabling a driver removes it from the registry but does not remove its telemetry health record, this continue prevents disabled: true/status: "disabled" from ever being surfaced for recently disabled drivers, so the UI keeps rendering Restart/Disable instead of Enable. This breaks the new disable/enable lifecycle flow until process restart or manual API use.
Useful? React with 👍 / 👎.
| s.deps.CfgMu.Lock() | ||
| found := false | ||
| for i := range s.deps.Cfg.Drivers { | ||
| if s.deps.Cfg.Drivers[i].Name == name { | ||
| s.deps.Cfg.Drivers[i].Disabled = disabled | ||
| found = true |
There was a problem hiding this comment.
Persist disable toggle before mutating live config
setDriverDisabled mutates s.deps.Cfg.Drivers[i].Disabled before attempting SaveConfig. If the save fails (disk full, permission error, etc.), the handler returns 500 but leaves the in-memory config changed, so runtime behavior and /api/status can diverge from on-disk config. This creates a split-brain state after a failed toggle and can trigger unexpected reload behavior later.
Useful? React with 👍 / 👎.
Summary
/api/drivers/{name}/{restart,disable,enable}endpointssameDriverConfignow compares theConfigmap, so credential changes actually restart the driver instead of being diffed awayev_credentials_saved+ per-driverhas_password(populated byMaskSecrets)Test plan
go test ./internal/{api,drivers,config}/...passesPOST /api/drivers/ferroamp/restart→{"source":"config","status":"restarted"})driver config changed, restartingfires after password edit🤖 Generated with Claude Code