Config UI: allow setting priority=0 (#20795)
This commit is contained in:
parent
2a403daa90
commit
956480f9cb
3 changed files with 16 additions and 3 deletions
|
|
@ -308,7 +308,7 @@ func (lp *Loadpoint) restoreSettings() {
|
|||
if v, err := lp.settings.String(keys.Mode); err == nil && v != "" && lp.DefaultMode == api.ModeEmpty {
|
||||
lp.setMode(api.ChargeMode(v))
|
||||
}
|
||||
if v, err := lp.settings.Int(keys.Priority); err == nil && v > 0 {
|
||||
if v, err := lp.settings.Int(keys.Priority); err == nil {
|
||||
lp.setPriority(int(v))
|
||||
}
|
||||
if v, err := lp.settings.Int(keys.PhasesConfigured); err == nil && (v > 0 || lp.hasPhaseSwitching()) {
|
||||
|
|
|
|||
|
|
@ -218,8 +218,7 @@ func (lp *Loadpoint) SetPriority(prio int) {
|
|||
defer lp.Unlock()
|
||||
|
||||
lp.log.DEBUG.Println("set priority:", prio)
|
||||
|
||||
if lp.Priority != prio {
|
||||
if lp.priority != prio {
|
||||
lp.setPriority(prio)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,6 +196,20 @@ test.describe("loadpoint", async () => {
|
|||
await page.getByTestId("loadpoint").nth(1).getByRole("button", { name: "edit" }).click();
|
||||
await expectModalVisible(lpModal);
|
||||
await expect(lpModal.getByLabel("Priority")).toHaveValue("1");
|
||||
|
||||
// change back to 0
|
||||
await lpModal.getByLabel("Priority").selectOption("0 (default)");
|
||||
await lpModal.getByRole("button", { name: "Save" }).click();
|
||||
await expectModalHidden(lpModal);
|
||||
|
||||
// restart
|
||||
await restart(CONFIG_ONE_LP);
|
||||
await page.reload();
|
||||
|
||||
// check priorities
|
||||
await page.getByTestId("loadpoint").nth(1).getByRole("button", { name: "edit" }).click();
|
||||
await expectModalVisible(lpModal);
|
||||
await expect(lpModal.getByLabel("Priority")).toHaveValue("0 (default)");
|
||||
});
|
||||
|
||||
test("vehicle", async ({ page }) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue