From 16f468142907aac96f1e8011662e49ff1fa4ee4c Mon Sep 17 00:00:00 2001 From: Maschga <88616799+Maschga@users.noreply.github.com> Date: Fri, 3 Oct 2025 16:45:56 +0200 Subject: [PATCH] Tariffs: switch to 15m slots (#21162) --- assets/css/app.css | 3 + .../ChargingPlans/PlanRepeatingSettings.vue | 18 +- .../ChargingPlans/PlanStaticSettings.vue | 15 +- .../components/ChargingPlans/Preview.test.ts | 47 ++-- .../js/components/ChargingPlans/Preview.vue | 59 +++-- assets/js/components/Forecast/ActiveSlot.vue | 10 +- assets/js/components/Forecast/Chart.vue | 6 +- assets/js/components/Forecast/Details.vue | 24 +- .../components/Loadpoints/SettingsModal.vue | 4 +- assets/js/components/Optimize/ChargeChart.vue | 85 ++++++- assets/js/components/Optimize/PriceChart.vue | 81 ++++++- assets/js/components/Optimize/SocChart.vue | 214 ++++++++++++------ .../Optimize/TimeSeriesDataTable.vue | 18 +- assets/js/components/Site/Site.vue | 2 +- .../js/components/Tariff/SmartTariffBase.vue | 60 ++--- assets/js/components/Tariff/TariffChart.vue | 58 ++--- assets/js/mixins/formatter.ts | 4 +- assets/js/types/evcc.ts | 5 +- assets/js/utils/forecast.test.ts | 57 +++++ assets/js/utils/forecast.ts | 23 ++ assets/js/views/Optimize.vue | 13 -- cmd/demo.yaml | 6 +- core/site_optimizer.go | 77 ++----- core/site_optimizer_test.go | 181 +++++++-------- go.mod | 1 - go.sum | 2 - i18n/de.json | 4 +- i18n/en.json | 4 +- server/http_loadpoint_handler.go | 42 ++-- tariff/config.go | 2 +- tariff/helper.go | 9 +- tariff/helper_test.go | 5 + tariff/slots.go | 67 ++++++ tariff/slots_test.go | 186 +++++++++++++++ tariff/tariff.go | 11 +- .../definition/tariff/demo-co2-forecast.yaml | 20 +- .../definition/tariff/demo-dynamic-grid.yaml | 117 ++++++++++ .../tariff/demo-solar-forecast.yaml | 26 ++- tests/plan.evcc.yaml | 2 +- 39 files changed, 1093 insertions(+), 475 deletions(-) create mode 100644 assets/js/utils/forecast.test.ts create mode 100644 tariff/slots.go create mode 100644 tariff/slots_test.go create mode 100644 templates/definition/tariff/demo-dynamic-grid.yaml diff --git a/assets/css/app.css b/assets/css/app.css index fb45ac972..b2c0f2763 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -702,3 +702,6 @@ input::-webkit-date-and-time-value { font-size: 0.875em; } } +.tabular { + font-variant-numeric: tabular-nums; +} diff --git a/assets/js/components/ChargingPlans/PlanRepeatingSettings.vue b/assets/js/components/ChargingPlans/PlanRepeatingSettings.vue index 5c012b737..f02f2f54b 100644 --- a/assets/js/components/ChargingPlans/PlanRepeatingSettings.vue +++ b/assets/js/components/ChargingPlans/PlanRepeatingSettings.vue @@ -24,7 +24,7 @@ {{ $t("main.chargingPlan.time") }} -
+
@@ -81,7 +81,7 @@ {{ $t("main.chargingPlan.goal") }}
-
+
-
+
-
+
@@ -83,7 +83,7 @@ {{ $t("main.chargingPlan.goal") }}
-
+