Battery UI: 100% buffersoc resets bufferstart (#29669)

This commit is contained in:
Michael Geers 2026-05-05 17:16:18 +02:00 • committed by GitHub
parent f5ce6e78bb
commit d4d8109a63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -379,7 +379,9 @@ export default defineComponent({
},
async changeBufferSoc($event: Event) {
const soc = parseInt(($event.target as HTMLInputElement).value, 10);
if (soc > this.bufferStartSoc && this.bufferStartSoc > 0) {
if (soc === 100) {
await this.setBufferStartSoc(0);
} else if (soc > this.bufferStartSoc && this.bufferStartSoc > 0) {
await this.setBufferStartSoc(soc);
}
await this.saveBufferSoc(soc);

View file

@ -38,16 +38,21 @@ test.describe("battery settings", async () => {
const topRow = page.getByText("Battery-supported vehicle charging");
const bufferSoc = topRow.getByRole("combobox").filter({ hasText: "disabled" });
const bufferStart = page.locator("#batterySettingsBufferStart");
await expect(bufferSoc).toHaveValue("100");
await expect(page.getByText("Start automatically")).toBeHidden();
await bufferSoc.selectOption({ label: "when above 80%" });
await expect(bufferSoc).toHaveValue("80");
await expect(page.getByText("Start automatically")).toBeVisible();
await bufferStart.selectOption({ label: "when above 90%." });
await bufferSoc.selectOption({ label: "disabled" });
await expect(page.getByText("Start automatically")).toBeHidden();
await bufferSoc.selectOption({ label: "when above 80%" });
await expect(topRow).toContainText("only with enough surplus.");
});
test("grid charging", async ({ page }) => {