Skip to content

Commit

Permalink
Planner: don’t show plan status in off/fast mode (#13222)
Browse files Browse the repository at this point in the history
  • Loading branch information
naltatis authored Mar 30, 2024
1 parent ea3ef49 commit 18436a1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 8 deletions.
26 changes: 26 additions & 0 deletions assets/js/components/VehicleStatus.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down
7 changes: 6 additions & 1 deletion assets/js/components/VehicleStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default {
heating: Boolean,
effectivePlanTime: String,
planProjectedStart: String,
chargingPlanDisabled: Boolean,
planActive: Boolean,
phaseAction: String,
phaseRemainingInterpolated: Number,
Expand Down Expand Up @@ -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");
}
Expand Down
6 changes: 3 additions & 3 deletions i18n/de.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 …"
Expand Down
6 changes: 3 additions & 3 deletions i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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…"
Expand Down
3 changes: 2 additions & 1 deletion tests/plan.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -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%"
Expand Down

0 comments on commit 18436a1

Please sign in to comment.