Repository navigation
Add EV Charger settings tab - #57
Conversation
Adds a new "EV Charger" tab to the Settings modal so users can configure Easee charger credentials (email, password, serial) without editing YAML. Includes a status indicator that polls /api/status for the Easee driver, and password masking that never reveals the stored value. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb9a354f7a
ℹ️ 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".
| var evHasPassword = !!getByPath(currentConfig, "ev_charger.password", ""); | ||
| html = '<div id="ev-status-indicator" class="ha-status-indicator">checking…</div>' + | ||
| '<fieldset><legend>EV Charger</legend>' + | ||
| selectField("Provider", "ev_charger.provider", ["easee"], "easee", |
There was a problem hiding this comment.
Bind EV settings to a persisted config path
The EV tab writes values under ev_charger.*, but the backend /api/config handler only round-trips fields defined in config.Config; there is no ev_charger field, and the Easee Lua driver expects credentials under a driver's config block. As a result, users can enter EV credentials and see a successful save, but those values are dropped on config POST/reload and never reach the charger driver.
Useful? React with 👍 / 👎.
| var drivers = d.drivers || []; | ||
| var easee = null; | ||
| for (var i = 0; i < drivers.length; i++) { | ||
| if ((drivers[i].name || "").toLowerCase().indexOf("easee") >= 0) { |
There was a problem hiding this comment.
Read /api/status drivers as object map
This code assumes d.drivers is an array and loops on drivers.length, but /api/status returns a driver map keyed by name. Since plain objects do not have a numeric length, the loop never runs, easee remains null, and the EV tab will incorrectly report “no Easee driver configured” even when an Easee driver is online.
Useful? React with 👍 / 👎.
| var val = input.type === "number" ? parseFloat(input.value) : input.value; | ||
| if (input.type === "number" && isNaN(val)) val = 0; | ||
| // Don't overwrite a saved password with empty string when user hasn't typed anything | ||
| if (input.type === "password" && val === "" && getByPath(currentConfig, path, "")) return; |
There was a problem hiding this comment.
Preserve ability to clear stored passwords
The new generic password guard skips writes whenever a password field is empty and a previous value exists, which makes it impossible to intentionally clear existing HA/MQTT/EV passwords via the Settings UI. In that scenario, the user deletes the masked value and saves, but the old secret is silently retained in config.
Useful? React with 👍 / 👎.
|
🎉 This PR is included in version 2.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
/api/statusto show whether the Easee driver is connectedev_chargerkey, matching the pattern used by other settings tabsTest plan
ev_chargerkey appears in configcd go && go test ./...passes (web-only changes, no backend impact)🤖 Generated with Claude Code