diff --git a/.changeset/ocpp-ui-honest-toggle.md b/.changeset/ocpp-ui-honest-toggle.md new file mode 100644 index 000000000..258772fc3 --- /dev/null +++ b/.changeset/ocpp-ui-honest-toggle.md @@ -0,0 +1,11 @@ +--- +"ftw": patch +--- + +Enabling the OCPP server from the Chargers panel now works on the first +try: the username field carries the real default ("ftw") instead of a +placeholder that validation then rejected, and saving an OCPP change +honestly reports that a restart is required — the central system +listener only starts at boot, so the previous "no restart needed" +answer left the port silently closed after an apparently successful +save. diff --git a/go/internal/config/restart_required.go b/go/internal/config/restart_required.go index 48e12ce67..79582b35b 100644 --- a/go/internal/config/restart_required.go +++ b/go/internal/config/restart_required.go @@ -77,6 +77,14 @@ func RestartRequiredFor(oldCfg, newCfg *Config) []string { if oldCfg.FleetPing.Resolved() != newCfg.FleetPing.Resolved() { reasons = append(reasons, "fleet_ping.endpoint — the sender resolves its endpoint at startup") } + // The OCPP central system is started once in main.go; the config + // applier neither starts, stops nor re-arms it. Without this entry + // the Chargers panel's enable toggle saved cleanly, reported no + // restart needed, and the listener never opened — the exact silent + // failure the comment at the top of this file warns about. + if !pointerEqual(oldCfg.OCPP, newCfg.OCPP) { + reasons = append(reasons, "ocpp — the central system listener is started at startup") + } if !pointerEqual(oldCfg.EVCharger, newCfg.EVCharger) { reasons = append(reasons, "ev_charger — EV charger client is constructed once at startup") } diff --git a/go/internal/config/restart_required_test.go b/go/internal/config/restart_required_test.go index 0a3f1286e..b51ef189e 100644 --- a/go/internal/config/restart_required_test.go +++ b/go/internal/config/restart_required_test.go @@ -83,6 +83,9 @@ func TestRestartRequiredFor_BootSections(t *testing.T) { {"ev_charger added", func(c *Config) { c.EVCharger = &EVCharger{Provider: "easee", Username: "a@b.c"} }, "ev_charger"}, + {"ocpp enabled", func(c *Config) { + c.OCPP = &OCPP{Enabled: true, Port: 8887, Username: "ftw", Password: "long-random-string"} + }, "ocpp"}, {"caldav credentials changed", func(c *Config) { c.CalDAV = &CalDAV{Enabled: true, Username: "calendar-user", Password: "rotated"} }, "caldav"}, diff --git a/web/settings/tabs/loadpoints.js b/web/settings/tabs/loadpoints.js index b195f499a..01bb1bfc7 100644 --- a/web/settings/tabs/loadpoints.js +++ b/web/settings/tabs/loadpoints.js @@ -142,7 +142,7 @@ '' + '