diff options
| author | diogo464 <[email protected]> | 2025-12-04 12:43:29 +0000 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-12-04 12:43:29 +0000 |
| commit | 98fd2306503a3ca80b9dfbdf4744547c836151c2 (patch) | |
| tree | d71edea00132cb349a431118716a284d90a8484d /src/unit.rs | |
| parent | 3289c2d9f6257f68cbdd37b78e5e79a41e9e33a1 (diff) | |
fixed temperature units
Diffstat (limited to 'src/unit.rs')
| -rw-r--r-- | src/unit.rs | 7 |
1 files changed, 3 insertions, 4 deletions
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 { | |||
| 8 | 8 | ||
| 9 | impl TemperatureUnit { | 9 | impl TemperatureUnit { |
| 10 | pub fn as_str(&self) -> &'static str { | 10 | pub fn as_str(&self) -> &'static str { |
| 11 | // TODO: improve | ||
| 12 | match self { | 11 | match self { |
| 13 | TemperatureUnit::Celcius => "C", | 12 | TemperatureUnit::Celcius => crate::constants::HA_UNIT_TEMPERATURE_CELSIUS, |
| 14 | TemperatureUnit::Kelvin => "k", | 13 | TemperatureUnit::Kelvin => crate::constants::HA_UNIT_TEMPERATURE_KELVIN, |
| 15 | TemperatureUnit::Fahrenheit => "F", | 14 | TemperatureUnit::Fahrenheit => crate::constants::HA_UNIT_TEMPERATURE_FAHRENHEIT, |
| 16 | TemperatureUnit::Other(other) => other, | 15 | TemperatureUnit::Other(other) => other, |
| 17 | } | 16 | } |
| 18 | } | 17 | } |
