Loadpoint: fix minSoc config error on restart (#31819)

This commit is contained in:
Michael Geers 2026-07-15 14:28:16 +02:00 • committed by GitHub
parent 85815e069a
commit bf4e6e8974
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 35 additions and 2 deletions

View file

@ -31,6 +31,7 @@ type DynamicConfig struct {
BatteryBoostLimit int `json:"batteryBoostLimit"`
LimitEnergy float64 `json:"limitEnergy"`
LimitSoc int `json:"limitSoc"`
MinSoc int `json:"minSoc"`
PlanStrategy api.PlanStrategy `json:"planStrategy"`
@ -75,6 +76,7 @@ func (payload DynamicConfig) Apply(lp API) error {
lp.SetBatteryBoostLimit(payload.BatteryBoostLimit)
lp.SetLimitEnergy(payload.LimitEnergy)
lp.SetLimitSoc(payload.LimitSoc)
lp.SetMinSoc(payload.MinSoc)
// TODO mode warning
lp.SetSocConfig(payload.Soc)

View file

@ -642,6 +642,25 @@ test.describe("heating loadpoint", async () => {
await lpModal.getByRole("button", { name: "Save" }).click();
await expectModalHidden(lpModal);
// set min temperature on main screen (stored in loadpoint device config)
await page.goto("/");
const settingsModal = page.getByTestId("loadpoint-settings-modal").first();
await page.getByTestId("loadpoint-settings-button").last().click();
await expectModalVisible(settingsModal);
await settingsModal.getByLabel("Min. temperature").selectOption("50.0°C");
await settingsModal.getByRole("button", { name: "Close" }).click();
await expectModalHidden(settingsModal);
// min temperature survives restart
await restart();
await page.reload();
await page.getByTestId("loadpoint-settings-button").last().click();
await expectModalVisible(settingsModal);
await expect(settingsModal.getByLabel("Min. temperature")).toHaveValue("50");
await settingsModal.getByRole("button", { name: "Close" }).click();
await expectModalHidden(settingsModal);
await page.goto("/#/config");
// delete
await lpEntry.getByRole("button", { name: "edit" }).click();
await expectModalVisible(lpModal);

View file

@ -1,11 +1,13 @@
import { test, expect } from "@playwright/test";
import { start, stop, baseUrl } from "./evcc";
import { start, stop, restart, baseUrl } from "./evcc";
import { expectModalHidden, expectModalVisible } from "./utils";
const CONFIG = "heating.evcc.yaml";
test.use({ baseURL: baseUrl() });
test.beforeAll(async () => {
await start("heating.evcc.yaml");
await start(CONFIG);
});
test.afterAll(async () => {
await stop();
@ -56,6 +58,16 @@ test.describe("integrated device", async () => {
await lp.getByTestId("loadpoint-settings-button").last().click();
await expectModalVisible(modal);
await expect(modal.getByLabel("Min. temperature")).toHaveValue("50");
await modal.getByRole("button", { name: "Close" }).click();
await expectModalHidden(modal);
// value survives restart
await restart(CONFIG);
await page.reload();
await expect(lp.getByTestId("vehicle-status-minsoc")).toContainText("50.0°C");
await lp.getByTestId("loadpoint-settings-button").last().click();
await expectModalVisible(modal);
await expect(modal.getByLabel("Min. temperature")).toHaveValue("50");
});
test("min current and phases but no max current for switch device", async ({ page }) => {