diff --git a/assets/js/components/Config/DeviceTags.vue b/assets/js/components/Config/DeviceTags.vue index 1ee6b3ed6a..6ab29b2355 100644 --- a/assets/js/components/Config/DeviceTags.vue +++ b/assets/js/components/Config/DeviceTags.vue @@ -58,7 +58,7 @@ export default { case "chargedEnergy": return this.fmtWh(value * 1e3); case "soc": - case "socLimit": + case "vehicleLimitSoc": return this.fmtPercentage(value, 1); case "temp": return this.fmtTemperature(value); diff --git a/i18n/de.toml b/i18n/de.toml index 98de66eebd..a44fcff258 100644 --- a/i18n/de.toml +++ b/i18n/de.toml @@ -85,11 +85,11 @@ power = "Leistung" powerRange = "Leistung" range = "Reichweite" singlePhase = "Einphasig" -soc = "SoC" -socLimit = "SoC Begrenzung" +soc = "Ladestand" temp = "Temperatur" topic = "Thema" url = "URL" +vehicleLimitSoc = "Fahrzeuglimit" yes = "Ja" [config.deviceValueChargeStatus] diff --git a/i18n/en.toml b/i18n/en.toml index d780793ab2..c0f6fc8746 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -88,11 +88,11 @@ power = "Power" powerRange = "Power" range = "Range" singlePhase = "Single phase" -soc = "SoC" -socLimit = "Limit" +soc = "Charge" temp = "Temperature" topic = "Topic" url = "URL" +vehicleLimitSoc = "Vehicle limit" yes = "yes" [config.deviceValueChargeStatus] diff --git a/server/http_config_device_handler.go b/server/http_config_device_handler.go index 39474ce86c..4de4ef1904 100644 --- a/server/http_config_device_handler.go +++ b/server/http_config_device_handler.go @@ -94,10 +94,16 @@ func deviceConfigMap[T any](class templates.Class, dev config.Device[T]) (map[st dc["id"] = configurable.ID() dc["config"] = params } else if title := conf.Other["title"]; title != nil { - // from yaml- add title only + // from yaml + config := make(map[string]any) if s, ok := title.(string); ok { - dc["config"] = map[string]any{"title": s} + config["title"] = s } + // add icon if available + if icon, ok := conf.Other["icon"].(string); ok { + config["icon"] = icon + } + dc["config"] = config } return dc, nil diff --git a/server/http_config_helper.go b/server/http_config_helper.go index 138c712d93..36073f2619 100644 --- a/server/http_config_helper.go +++ b/server/http_config_helper.go @@ -192,8 +192,8 @@ func testInstance(instance any) map[string]testResult { res["phases1p3p"] = makeResult(true, nil) } - if cc, ok := instance.(api.PhaseDescriber); ok { - res["singlePhase"] = makeResult(cc.Phases() == 1, nil) + if cc, ok := instance.(api.PhaseDescriber); ok && cc.Phases() == 1 { + res["singlePhase"] = makeResult(true, nil) } if dev, ok := instance.(api.VehicleRange); ok { @@ -203,7 +203,7 @@ func testInstance(instance any) map[string]testResult { if dev, ok := instance.(api.SocLimiter); ok { val, err := dev.GetLimitSoc() - res["socLimit"] = makeResult(val, err) + res["vehicleLimitSoc"] = makeResult(val, err) } if dev, ok := instance.(api.Identifier); ok {