From a35a705e481a040ae9a9d7496cb1bcc563a66031 Mon Sep 17 00:00:00 2001 From: Maschga <88616799+Maschga@users.noreply.github.com> Date: Sun, 1 Dec 2024 12:53:11 +0100 Subject: [PATCH] Add schedule for planner (#16091) --- api/plans.go | 9 + assets/css/app.css | 4 + assets/js/components/ChargingPlan.vue | 49 ++- .../js/components/ChargingPlanPreview.test.js | 4 +- assets/js/components/ChargingPlanPreview.vue | 37 +- .../ChargingPlanRepeatingSettings.vue | 244 ++++++++++++ assets/js/components/ChargingPlanSettings.vue | 200 ---------- ...try.vue => ChargingPlanStaticSettings.vue} | 89 +++-- assets/js/components/ChargingPlanWarnings.vue | 16 +- .../ChargingPlansRepeatingSettings.vue | 94 +++++ .../js/components/ChargingPlansSettings.vue | 338 +++++++++++++++++ assets/js/components/CustomSelect.vue | 12 +- assets/js/components/MultiSelect.vue | 45 +-- assets/js/components/TariffChart.vue | 167 +++++--- assets/js/mixins/formatter.js | 68 ++++ assets/js/mixins/formatter.test.js | 32 ++ core/keys/loadpoint.go | 4 + core/loadpoint/api.go | 2 + core/loadpoint/mock.go | 14 + core/loadpoint_effective.go | 63 +++- core/loadpoint_plan.go | 2 +- core/site_vehicles.go | 51 +-- core/vehicle/adapter.go | 35 ++ core/vehicle/api.go | 5 + core/vehicle/dummy.go | 9 + core/vehicle/mock.go | 28 ++ i18n/de.toml | 7 + i18n/en.toml | 7 + server/http.go | 54 +-- server/http_loadpoint_handler.go | 62 ++- server/http_vehicle_handler.go | 32 ++ tests/plan.spec.js | 355 ++++++++++++++++-- util/time.go | 54 +++ 33 files changed, 1771 insertions(+), 421 deletions(-) create mode 100644 api/plans.go create mode 100644 assets/js/components/ChargingPlanRepeatingSettings.vue delete mode 100644 assets/js/components/ChargingPlanSettings.vue rename assets/js/components/{ChargingPlanSettingsEntry.vue => ChargingPlanStaticSettings.vue} (81%) create mode 100644 assets/js/components/ChargingPlansRepeatingSettings.vue create mode 100644 assets/js/components/ChargingPlansSettings.vue create mode 100644 util/time.go diff --git a/api/plans.go b/api/plans.go new file mode 100644 index 0000000000..dc2b038ad8 --- /dev/null +++ b/api/plans.go @@ -0,0 +1,9 @@ +package api + +type RepeatingPlanStruct struct { + Weekdays []int `json:"weekdays"` // 0-6 (Sunday-Saturday) + Time string `json:"time"` // HH:MM + Tz string `json:"tz"` // timezone in IANA format + Soc int `json:"soc"` + Active bool `json:"active"` +} diff --git a/assets/css/app.css b/assets/css/app.css index 40ecaa9fc4..1a83bf9de1 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -632,3 +632,7 @@ html.app .modal-dialog { .alert-danger code { color: var(--evcc-darkest-green); } + +input::-webkit-date-and-time-value { + text-align: left; +} diff --git a/assets/js/components/ChargingPlan.vue b/assets/js/components/ChargingPlan.vue index 94cc8c29a2..3fbaa6d53d 100644 --- a/assets/js/components/ChargingPlan.vue +++ b/assets/js/components/ChargingPlan.vue @@ -7,7 +7,12 @@ data-testid="charging-plan" >
-