aboutsummaryrefslogtreecommitdiff
path: root/src/unit.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/unit.rs')
-rw-r--r--src/unit.rs7
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
9impl TemperatureUnit { 9impl 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 }