From 32b4f4dd772f9eef37f298980e1ab98b461e2805 Mon Sep 17 00:00:00 2001 From: Avii Date: Sun, 16 Aug 2026 19:39:32 +0200 Subject: [PATCH] 1786901972 --- dashboard/src/ha_ext.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dashboard/src/ha_ext.rs b/dashboard/src/ha_ext.rs index 76e9a63..97534b1 100644 --- a/dashboard/src/ha_ext.rs +++ b/dashboard/src/ha_ext.rs @@ -174,7 +174,20 @@ impl From<&crate::home_assistant::CalendarEvent> for CalendarEventData { impl From for BatteryData { fn from(value: RawBatteryData) -> Self { - let state = value.state.to_shared_string(); + let state = value + .state + .to_string() + .split_whitespace() + .map(|word| { + let mut c = word.chars(); + match c.next() { + None => String::new(), + Some(first_char) => first_char.to_uppercase().collect::() + c.as_str(), + } + }) + .collect::>() + .join(" ") + .to_shared_string(); let percent: f32 = (value.state_of_charge * 100.).into(); let percent = percent.round();