Don't show boost button by default for ui-created loadpoints (#27504)
Some checks failed
Release / call-build-workflow (push) Has been cancelled
Release / Publish Docker :release (push) Has been cancelled
Release / Github & APT (push) Has been cancelled
Release / Demo (push) Has been cancelled
Release / Hassio Addon (push) Has been cancelled

This commit is contained in:
Michael Geers 2026-02-19 10:03:25 +01:00 • committed by GitHub
parent fced4194de
commit d813989648
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 42 additions and 10 deletions

View file

@ -44,6 +44,7 @@ func SplitConfig(payload map[string]any) (DynamicConfig, map[string]any, error)
DynamicConfig `mapstructure:",squash"`
Other map[string]any `mapstructure:",remain"`
}
cc.BatteryBoostLimit = 100 // default: disabled
if err := util.DecodeOther(payload, &cc); err != nil {
return DynamicConfig{}, nil, err

View file

@ -1,21 +1,18 @@
import { test, expect } from "@playwright/test";
import { start, stop, baseUrl } from "./evcc";
import { expectModalHidden } from "./utils";
import { start, stop, restart, baseUrl } from "./evcc";
import { expectModalHidden, newLoadpoint, addDemoCharger } from "./utils";
test.use({ baseURL: baseUrl() });
test.beforeAll(async () => {
await start("battery-settings.evcc.yaml");
});
test.afterAll(async () => {
await stop();
});
const CONFIG_BATTERY = "battery-settings.evcc.yaml";
test.beforeEach(async ({ page }) => {
await page.goto("/");
test.afterEach(async () => {
await stop();
});
test.describe("boost", async () => {
test("activate and deactivate boost in solar mode", async ({ page }) => {
await start(CONFIG_BATTERY);
await page.goto("/");
const boostButton = page.getByTestId("battery-boost-button");
await expect(boostButton).not.toBeVisible();
await page
@ -42,6 +39,8 @@ test.describe("boost", async () => {
});
test("battery too low for boost when limit above soc", async ({ page }) => {
await start(CONFIG_BATTERY);
await page.goto("/");
const boostButton = page.getByTestId("battery-boost-button");
await page
.getByTestId("mode")
@ -60,6 +59,8 @@ test.describe("boost", async () => {
});
test("boost button disabled in fast mode", async ({ page }) => {
await start(CONFIG_BATTERY);
await page.goto("/");
const boostButton = page.getByTestId("battery-boost-button");
// set a boost limit in solar mode so the boost button appears
await page
@ -78,4 +79,34 @@ test.describe("boost", async () => {
await page.getByTestId("mode").first().getByRole("button", { name: "Fast" }).click();
await expect(boostButton).toBeDisabled();
});
test("boost default for ui-created loadpoint", async ({ page }) => {
await start(CONFIG_BATTERY);
// create a second loadpoint via config UI
await page.goto("/#/config");
await newLoadpoint(page, "New Charger");
await addDemoCharger(page);
const lpModal = page.getByTestId("loadpoint-modal");
await lpModal.getByRole("button", { name: "Save" }).click();
await expectModalHidden(lpModal);
// restart evcc to apply new loadpoint
await restart(CONFIG_BATTERY);
await page.goto("/");
await expect(page.getByTestId("loadpoint")).toHaveCount(2);
// boost button on new loadpoint should not be visible (batteryBoostLimit defaults to 100 = disabled)
const boostButton = page.getByTestId("battery-boost-button");
await expect(boostButton).not.toBeVisible();
// set boost limit to 50% on new loadpoint and verify button appears
await page.getByTestId("loadpoint-settings-button").last().click();
const modal = page.getByTestId("loadpoint-settings-modal").last();
await modal.getByTestId("battery-boost-limit").selectOption("50 %");
await page.waitForLoadState("networkidle");
await modal.getByLabel("Close").click();
await expectModalHidden(modal);
await expect(boostButton).toBeVisible();
});
});