From de4132636996288557ee6038cc3471ea52ff1b74 Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Wed, 13 Aug 2025 07:36:01 +0200 Subject: [PATCH] Config UI: fix icon in customer chargers (#22947) --- assets/js/components/Config/ChargerModal.vue | 4 ++++ assets/js/components/Config/defaultYaml/customCharger.yaml | 1 + assets/js/components/Config/defaultYaml/customHeater.yaml | 2 ++ .../js/components/Config/defaultYaml/switchsocketCharger.yaml | 1 + .../js/components/Config/defaultYaml/switchsocketHeater.yaml | 2 ++ 5 files changed, 10 insertions(+) diff --git a/assets/js/components/Config/ChargerModal.vue b/assets/js/components/Config/ChargerModal.vue index 3268859ef..6b5cc176d 100644 --- a/assets/js/components/Config/ChargerModal.vue +++ b/assets/js/components/Config/ChargerModal.vue @@ -304,6 +304,10 @@ export default defineComponent({ if (this.values.type === ConfigType.Template) { data["template"] = this.templateName; } + if (this.showYamlInput) { + // Icon is extracted from yaml on GET for UI purpose only. Don't write it back. + delete data["icon"]; + } return data; }, isNew() { diff --git a/assets/js/components/Config/defaultYaml/customCharger.yaml b/assets/js/components/Config/defaultYaml/customCharger.yaml index 6c1a8140e..7b295b5b1 100644 --- a/assets/js/components/Config/defaultYaml/customCharger.yaml +++ b/assets/js/components/Config/defaultYaml/customCharger.yaml @@ -15,6 +15,7 @@ maxcurrent: # set maximum charge current in A ## optional attributes (read-only) +#icon: generic # icon for UI purpose only #power: # charge power in W # source: const # value: 11000 diff --git a/assets/js/components/Config/defaultYaml/customHeater.yaml b/assets/js/components/Config/defaultYaml/customHeater.yaml index 640e2c6a9..eec43ca29 100644 --- a/assets/js/components/Config/defaultYaml/customHeater.yaml +++ b/assets/js/components/Config/defaultYaml/customHeater.yaml @@ -17,6 +17,8 @@ features: - heating # treat as a heating device - integrateddevice # no charging sessions, no connected vehicles +icon: heater # icon for UI purpose only + ## optional attributes (read-only) #power: # heating power in W diff --git a/assets/js/components/Config/defaultYaml/switchsocketCharger.yaml b/assets/js/components/Config/defaultYaml/switchsocketCharger.yaml index 2f9f62d47..76afcce9a 100644 --- a/assets/js/components/Config/defaultYaml/switchsocketCharger.yaml +++ b/assets/js/components/Config/defaultYaml/switchsocketCharger.yaml @@ -16,6 +16,7 @@ features: ## optional attributes (read-only) +#icon: generic # icon for UI purpose only #energy: # meter reading in kWh # source: const # value: 42.5 diff --git a/assets/js/components/Config/defaultYaml/switchsocketHeater.yaml b/assets/js/components/Config/defaultYaml/switchsocketHeater.yaml index 082ffc85f..74a4d628f 100644 --- a/assets/js/components/Config/defaultYaml/switchsocketHeater.yaml +++ b/assets/js/components/Config/defaultYaml/switchsocketHeater.yaml @@ -15,6 +15,8 @@ features: - heating # treat as a heating device - integrateddevice # no charging sessions, no connected vehicles +icon: heater # icon for UI purpose only + ## optional attributes (read-only) #energy: # meter reading in kWh