From c61e3faac99ce91adbdf834befd16aee0d5f9ece Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Tue, 19 May 2026 11:07:39 +0200 Subject: [PATCH] Battery: fix stale grid charge limit reset (#30013) --- .../js/components/Tariff/SmartCostLimit.vue | 2 +- .../components/Tariff/SmartFeedInPriority.vue | 2 +- .../js/components/Tariff/SmartTariffBase.vue | 7 ++- assets/js/views/Battery.vue | 5 ++- cmd/demo.yaml | 10 ----- tests/smart-cost-reset-warning.evcc.yaml | 39 ++++++++++++++++ tests/smart-cost-reset-warning.spec.ts | 44 +++++++++++++++++++ tests/smart-cost-reset-warning.sql | 8 ++++ 8 files changed, 103 insertions(+), 14 deletions(-) create mode 100644 tests/smart-cost-reset-warning.evcc.yaml create mode 100644 tests/smart-cost-reset-warning.spec.ts create mode 100644 tests/smart-cost-reset-warning.sql diff --git a/assets/js/components/Tariff/SmartCostLimit.vue b/assets/js/components/Tariff/SmartCostLimit.vue index f492c5e63..89383a28b 100644 --- a/assets/js/components/Tariff/SmartCostLimit.vue +++ b/assets/js/components/Tariff/SmartCostLimit.vue @@ -60,7 +60,7 @@ export default defineComponent({ description: lp ? t("loadpointDescription") : t("batteryDescription"), limitLabel: co2 ? t("co2Limit") : t("priceLimit"), currentPriceLabel: co2 ? t("co2Label") : t("priceLabel"), - resetWarningText: t("resetWarning"), + resetWarningKey: "smartCost.resetWarning", activeHoursLabel: t("activeHoursLabel"), }; }, diff --git a/assets/js/components/Tariff/SmartFeedInPriority.vue b/assets/js/components/Tariff/SmartFeedInPriority.vue index e66af5bd2..191a7a12d 100644 --- a/assets/js/components/Tariff/SmartFeedInPriority.vue +++ b/assets/js/components/Tariff/SmartFeedInPriority.vue @@ -53,7 +53,7 @@ export default defineComponent({ limitLabel: t("priceLimit"), activeHoursLabel: t("activeHoursLabel"), currentPriceLabel: t("priceLabel"), - resetWarningText: t("resetWarning"), + resetWarningKey: "smartFeedInPriority.resetWarning", }; }, }, diff --git a/assets/js/components/Tariff/SmartTariffBase.vue b/assets/js/components/Tariff/SmartTariffBase.vue index 84409f849..2f296ab54 100644 --- a/assets/js/components/Tariff/SmartTariffBase.vue +++ b/assets/js/components/Tariff/SmartTariffBase.vue @@ -123,7 +123,7 @@ export default defineComponent({ optionsStartAtZero: Boolean, activeHoursLabel: { type: String, required: true }, currentPriceLabel: String, - resetWarningText: String, + resetWarningKey: String, limitDirection: { type: String as PropType, default: "below" }, highlightColor: { type: String as PropType, default: "text-primary" }, isSlotActive: { @@ -261,6 +261,11 @@ export default defineComponent({ limitOperator() { return this.limitDirection === "below" ? "≤" : "≥"; }, + resetWarningText() { + return this.$t(this.resetWarningKey!, { + limit: this.formatValue(this.currentLimit!), + }); + }, }, watch: { currentLimit() { diff --git a/assets/js/views/Battery.vue b/assets/js/views/Battery.vue index 3e8deba75..f0afdff7c 100644 --- a/assets/js/views/Battery.vue +++ b/assets/js/views/Battery.vue @@ -8,7 +8,7 @@ {{ $t("batterySettings.usageTab") }} -