Skip to content

Commit a9e1f17

Browse files
Antonio ...claude
andcommitted
fix(ui): v2.10.1 — Stop Charging toggle turns red when ON, not green
On this dashboard green reads as "charging", so the new Stop Charging toggle (#55) lighting up green while meaning the opposite undercut the point of the control. The toggle's active accent is now the CSS variable `--evsc-toggle-on` (declared on .control-toggle, default system green) and is consumed by .control-toggle.is-on (border / background tint / halo) and .switch-shell.is-on (the iOS pill). One rule, `.control-toggle.tone-red { --evsc-toggle-on: var(--evsc-sys-red); }`, flips the whole ON treatment to system red for that single toggle. The pill keeps a green fallback so shells rendered outside a .control-toggle are untouched. Verified in the preview harness in light and dark: ON card / border / halo tinted red with the pill at #ff3b30, while Force Charging, Boost and every other toggle keep #34c759 byte-for-byte. Frontend-only. No schema / entity / config-flow change, counts unchanged (72/58). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 967afea commit a9e1f17

4 files changed

Lines changed: 52 additions & 7 deletions

File tree

‎CLAUDE.md‎

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
77
This is a **Home Assistant custom integration** for intelligent EV charging control. It manages EV charger automation based on solar production, time of day, battery levels, grid import protection, and intelligent priority balancing between EV and home battery charging.
88

99
**Domain:** `ev_smart_charger`
10-
**Current Version:** 2.10.0
10+
**Current Version:** 2.10.1
1111
**Installation:** HACS custom repository or manual installation to `custom_components/ev_smart_charger`
1212

1313
## Development Commands
@@ -757,6 +757,40 @@ async def _set_amperage(self, target_amperage: int):
757757

758758
## Version History
759759

760+
### v2.10.1 (2026-08-20)
761+
**UI: the Stop Charging toggle is red when ON (frontend-only)**
762+
763+
Follow-up to v2.10.0. Every `.control-toggle` shares one "active" treatment —
764+
an Apple-system-green tinted card, border, focus halo and iOS pill. On this
765+
dashboard green reads as *charging*, so the new Stop Charging toggle lit up
766+
green while meaning the exact opposite, undercutting the whole point of the
767+
control (issue #55, Motivation #2: remove the force-charge foot-gun).
768+
769+
The accent is now a CSS variable instead of a hardcoded color:
770+
`--evsc-toggle-on` is declared on `.control-toggle` (default
771+
`var(--evsc-sys-green)`) and consumed by `.control-toggle.is-on` (border,
772+
background tint, halo) and `.switch-shell.is-on` (the pill). A single
773+
`.control-toggle.tone-red { --evsc-toggle-on: var(--evsc-sys-red); }` rule
774+
flips the whole ON treatment to system red for the one toggle whose ON state
775+
means "no charging". `.switch-shell.is-on` keeps a
776+
`var(--evsc-toggle-on, var(--evsc-sys-green))` fallback so the shells rendered
777+
outside a `.control-toggle` (settings rows, weekly-planner cells) are
778+
untouched.
779+
780+
Verified in the preview harness in both schemes: ON card
781+
`color-mix(--evsc-sys-red 8%)` + 45% border + 12% halo, pill `#ff3b30`, while
782+
Force Charging / Boost / every other toggle keep `#34c759` byte-for-byte.
783+
784+
**Files**: `frontend/ev-smart-charger-dashboard.js` (CSS only), `const.py`,
785+
`manifest.json`, this file. `VERSION = "2.10.1"`. No schema / entity /
786+
config-flow change, entity counts unchanged (72 / 58). The `?v=`+content-hash
787+
cache-buster delivers the new bundle on the next dashboard reload.
788+
789+
**Upgrade priority**: 🟢 RECOMMENDED for anyone on v2.10.0 who uses the
790+
dashboard — purely visual.
791+
792+
---
793+
760794
### v2.10.0 (2026-08-20)
761795
**FIX: Smart Charger Blocker released every block after ~30-60 s (issue #54) + FEATURE: manual "Stop Charging" control (issue #55)**
762796

‎custom_components/ev_smart_charger/const.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# ========== INTEGRATION METADATA ==========
44
DOMAIN = "ev_smart_charger"
5-
VERSION = "2.10.0"
5+
VERSION = "2.10.1"
66
DEFAULT_NAME = "EV Smart Charger"
77
FRONTEND_URL_BASE = "/api/ev_smart_charger/frontend"
88
FRONTEND_CARD_FILENAME = "ev-smart-charger-dashboard.js"

‎custom_components/ev_smart_charger/frontend/ev-smart-charger-dashboard.js‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3736,12 +3736,23 @@ class EvSmartChargerDashboard extends HTMLElement {
37363736
grid-template-columns: 1fr auto;
37373737
background: var(--evsc-surface-strong);
37383738
border: 1px solid var(--evsc-stroke);
3739+
/* v2.10.1: the "active" accent of a toggle. Green everywhere (ON =
3740+
charging / feature running), overridden per-toggle where ON means
3741+
the opposite — see .tone-red below. */
3742+
--evsc-toggle-on: var(--evsc-sys-green);
3743+
}
3744+
3745+
/* v2.10.1 (issue #55): Stop Charging is the one toggle whose ON state
3746+
means "no charging", so it must not borrow the green that reads as
3747+
"charging" everywhere else on this dashboard. */
3748+
.control-toggle.tone-red {
3749+
--evsc-toggle-on: var(--evsc-sys-red);
37393750
}
37403751
37413752
.control-toggle.is-on {
3742-
border-color: color-mix(in srgb, var(--evsc-sys-green) 45%, transparent);
3743-
background: color-mix(in srgb, var(--evsc-sys-green) 8%, var(--evsc-surface-strong));
3744-
box-shadow: 0 0 0 4px color-mix(in srgb, var(--evsc-sys-green) 12%, transparent),
3753+
border-color: color-mix(in srgb, var(--evsc-toggle-on) 45%, transparent);
3754+
background: color-mix(in srgb, var(--evsc-toggle-on) 8%, var(--evsc-surface-strong));
3755+
box-shadow: 0 0 0 4px color-mix(in srgb, var(--evsc-toggle-on) 12%, transparent),
37453756
var(--evsc-shadow-soft);
37463757
}
37473758
@@ -3770,7 +3781,7 @@ class EvSmartChargerDashboard extends HTMLElement {
37703781
}
37713782
37723783
.switch-shell.is-on {
3773-
background: var(--evsc-sys-green);
3784+
background: var(--evsc-toggle-on, var(--evsc-sys-green));
37743785
}
37753786
37763787
.switch-thumb {

‎custom_components/ev_smart_charger/manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"iot_class": "local_push",
1212
"issue_tracker": "https://github.com/antbald/ha-ev-smart-charger/issues",
1313
"requirements": [],
14-
"version": "2.10.0"
14+
"version": "2.10.1"
1515
}

0 commit comments

Comments
 (0)