From 18436a1d689aaabcc2167b201a3dbcef56cae370 Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Sat, 30 Mar 2024 21:51:12 +0100 Subject: [PATCH] =?UTF-8?q?Planner:=20don=E2=80=99t=20show=20plan=20status?= =?UTF-8?q?=20in=20off/fast=20mode=20(#13222)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/js/components/VehicleStatus.test.js | 26 ++++++++++++++++++++++ assets/js/components/VehicleStatus.vue | 7 +++++- i18n/de.toml | 6 ++--- i18n/en.toml | 6 ++--- tests/plan.spec.js | 3 ++- 5 files changed, 40 insertions(+), 8 deletions(-) diff --git a/assets/js/components/VehicleStatus.test.js b/assets/js/components/VehicleStatus.test.js index 3a18ed3d9..7636329a2 100644 --- a/assets/js/components/VehicleStatus.test.js +++ b/assets/js/components/VehicleStatus.test.js @@ -68,6 +68,32 @@ describe("plan", () => { } ); }); + test("dont show plan status if plan is disabled (e.g. off, fast mode)", () => { + expectStatus( + { + effectivePlanTime, + planActive: true, + charging: true, + connected: true, + chargingPlanDisabled: true, + }, + "charging" + ); + expectStatus( + { + effectivePlanTime, + planActive: true, + enabled: true, + connected: true, + chargingPlanDisabled: true, + }, + "waitForVehicle" + ); + expectStatus( + { effectivePlanTime, planProjectedStart, connected: true, chargingPlanDisabled: true }, + "connected" + ); + }); }); describe("climating", () => { diff --git a/assets/js/components/VehicleStatus.vue b/assets/js/components/VehicleStatus.vue index 8485c206d..cb4862d92 100644 --- a/assets/js/components/VehicleStatus.vue +++ b/assets/js/components/VehicleStatus.vue @@ -20,6 +20,7 @@ export default { heating: Boolean, effectivePlanTime: String, planProjectedStart: String, + chargingPlanDisabled: Boolean, planActive: Boolean, phaseAction: String, phaseRemainingInterpolated: Number, @@ -67,7 +68,11 @@ export default { } // plan - if (this.effectivePlanTime && !this.targetChargeDisabled) { + if ( + !this.chargingPlanDisabled && + this.effectivePlanTime && + !this.targetChargeDisabled + ) { if (this.planActive && this.charging) { return t("targetChargeActive"); } diff --git a/i18n/de.toml b/i18n/de.toml index 54a954b60..80928cbb6 100644 --- a/i18n/de.toml +++ b/i18n/de.toml @@ -365,9 +365,9 @@ pvDisable = "Zu wenig Überschuss. Pausiere in {remaining} …" pvEnable = "Überschuss verfügbar. Starte in {remaining} …" scale1p = "Reduziere auf einphasig in {remaining} …" scale3p = "Erhöhe auf dreiphasig in {remaining} …" -targetChargeActive = "Zielladen aktiv …" -targetChargePlanned = "Zielladen geplant. Ladung startet {time} Uhr." -targetChargeWaitForVehicle = "Zielladen bereit. Warte auf Fahrzeug …" +targetChargeActive = "Ladeplan aktiv …" +targetChargePlanned = "Ladeplan startet {time} Uhr." +targetChargeWaitForVehicle = "Ladeplan bereit. Warte auf Fahrzeug …" unknown = "" vehicleLimitReached = "Fahrzeuglimit {soc}% erreicht." waitForVehicle = "Ladebereit. Warte auf Fahrzeug …" diff --git a/i18n/en.toml b/i18n/en.toml index 02d732f20..0c922293e 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -362,9 +362,9 @@ pvDisable = "Not enough surplus. Pausing in {remaining}…" pvEnable = "Surplus available. Starting in {remaining}…" scale1p = "Reducing to 1-phase charging in {remaining}…" scale3p = "Increasing to 3-phase charging in {remaining}…" -targetChargeActive = "Target charge active…" -targetChargePlanned = "Target charging starts at {time}." -targetChargeWaitForVehicle = "Target charge ready. Waiting for vehicle…" +targetChargeActive = "Charging plan active…" +targetChargePlanned = "Charging plan starts at {time}." +targetChargeWaitForVehicle = "Charging plan ready. Waiting for vehicle…" unknown = "" vehicleLimitReached = "Vehicle limit {soc}% reached." waitForVehicle = "Ready. Waiting for vehicle…" diff --git a/tests/plan.spec.js b/tests/plan.spec.js index f766690f1..b2a48d847 100644 --- a/tests/plan.spec.js +++ b/tests/plan.spec.js @@ -44,6 +44,7 @@ test.describe("basic functionality", async () => { await expect(lp1.getByText("Loadpoint", { exact: true })).toBeVisible(); await lp1.getByTestId("limit-soc").getByRole("combobox").selectOption("90%"); + await lp1.getByRole("button", { name: "Solar", exact: true }).click(); await lp1.getByTestId("charging-plan").getByRole("button", { name: "none" }).click(); await page.getByTestId("plan-day").selectOption({ index: 1 }); @@ -57,7 +58,7 @@ test.describe("basic functionality", async () => { "tomorrow 9:30 AM80%" ); - await expect(lp1.getByTestId("vehicle-status")).toContainText("Target charging starts at"); + await expect(lp1.getByTestId("vehicle-status")).toContainText("Charging plan starts at"); await expect(lp1.getByTestId("plan-marker")).toBeVisible(); await expect(lp1.getByTestId("charging-plan").getByRole("button")).toHaveText( "tomorrow 9:30 AM80%"