From 98fd2306503a3ca80b9dfbdf4744547c836151c2 Mon Sep 17 00:00:00 2001 From: diogo464 Date: Thu, 4 Dec 2025 12:43:29 +0000 Subject: fixed temperature units --- src/unit.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/unit.rs') diff --git a/src/unit.rs b/src/unit.rs index 4f3ca19..f0557da 100644 --- a/src/unit.rs +++ b/src/unit.rs @@ -8,11 +8,10 @@ pub enum TemperatureUnit { impl TemperatureUnit { pub fn as_str(&self) -> &'static str { - // TODO: improve match self { - TemperatureUnit::Celcius => "C", - TemperatureUnit::Kelvin => "k", - TemperatureUnit::Fahrenheit => "F", + TemperatureUnit::Celcius => crate::constants::HA_UNIT_TEMPERATURE_CELSIUS, + TemperatureUnit::Kelvin => crate::constants::HA_UNIT_TEMPERATURE_KELVIN, + TemperatureUnit::Fahrenheit => crate::constants::HA_UNIT_TEMPERATURE_FAHRENHEIT, TemperatureUnit::Other(other) => other, } } -- cgit