Show guard disable timer (#8100)
This commit is contained in:
parent
ec81ad4d12
commit
f08dea2c47
2 changed files with 23 additions and 8 deletions
|
|
@ -134,23 +134,38 @@ describe("timer", () => {
|
|||
test("show guard timer if it exists", () => {
|
||||
expectStatus(
|
||||
{
|
||||
guardAction: "enable",
|
||||
connected: true,
|
||||
guardAction: "enable",
|
||||
guardRemainingInterpolated: 90,
|
||||
},
|
||||
"guard",
|
||||
{ remaining: "1:30m" }
|
||||
);
|
||||
});
|
||||
test("don't show guard timer if charging", () => {
|
||||
test("don't show guard timer if another timer exists", () => {
|
||||
expectStatus(
|
||||
{
|
||||
guardAction: "enable",
|
||||
connected: true,
|
||||
charging: true,
|
||||
pvAction: "disable",
|
||||
pvRemainingInterpolated: 30,
|
||||
guardAction: "enable",
|
||||
guardRemainingInterpolated: 90,
|
||||
},
|
||||
"charging"
|
||||
"pvDisable",
|
||||
{ remaining: "30s" }
|
||||
);
|
||||
});
|
||||
test("show guard timer if charging and no other timer exists", () => {
|
||||
expectStatus(
|
||||
{
|
||||
connected: true,
|
||||
charging: true,
|
||||
guardAction: "enable",
|
||||
guardRemainingInterpolated: 90,
|
||||
},
|
||||
"guard",
|
||||
{ remaining: "1:30m" }
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -116,16 +116,16 @@ export default {
|
|||
});
|
||||
}
|
||||
|
||||
if (this.charging) {
|
||||
return t("charging");
|
||||
}
|
||||
|
||||
if (this.guardTimerActive) {
|
||||
return t("guard", {
|
||||
remaining: this.fmtShortDuration(this.guardRemainingInterpolated, true),
|
||||
});
|
||||
}
|
||||
|
||||
if (this.charging) {
|
||||
return t("charging");
|
||||
}
|
||||
|
||||
return t("connected");
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue