Skip to content

Add EV Charger settings tab - #57

Merged
frahlg merged 1 commit into
masterfrom
ev-charger-settings-tab
Apr 16, 2026
Merged

frahlg merged 1 commit into
masterfrom
ev-charger-settings-tab

Conversation

@frahlg

@frahlg frahlg commented Apr 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds an "EV Charger" tab to the Settings modal with fields for provider (Easee), email, password, and charger serial
  • Password field uses type="password" with placeholder masking — never reveals the stored value
  • Status indicator polls /api/status to show whether the Easee driver is connected
  • Writes config under ev_charger key, matching the pattern used by other settings tabs
  • Fixes a generic issue where empty password fields would overwrite saved passwords on save

Test plan

  • Open Settings modal, verify "EV Charger" tab appears after "Home Assistant"
  • Click tab, verify fields render: Provider dropdown (Easee), Email, Password, Charger serial
  • Enter credentials and save — verify ev_charger key appears in config
  • Reopen settings — verify email/serial are populated, password shows dots placeholder
  • Verify status indicator shows charger status (or "no Easee driver configured")
  • cd go && go test ./... passes (web-only changes, no backend impact)

🤖 Generated with Claude Code

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]>
@frahlg
frahlg merged commit 65fa36f into master Apr 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread web/settings.js
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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread web/settings.js
Comment on lines +447 to +450
var drivers = d.drivers || [];
var easee = null;
for (var i = 0; i < drivers.length; i++) {
if ((drivers[i].name || "").toLowerCase().indexOf("easee") >= 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread web/settings.js
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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant