From 6f8dab347c56023559ef1bb839d01a6cd9aceafe Mon Sep 17 00:00:00 2001 From: Steve2Go Date: Wed, 8 May 2024 12:20:37 +1000 Subject: [PATCH] Update ge_climate.py --- .../ge_home/entities/common/ge_climate.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/custom_components/ge_home/entities/common/ge_climate.py b/custom_components/ge_home/entities/common/ge_climate.py index 1487caf..58cbbe1 100644 --- a/custom_components/ge_home/entities/common/ge_climate.py +++ b/custom_components/ge_home/entities/common/ge_climate.py @@ -99,10 +99,20 @@ def is_on(self) -> bool: @property def target_temperature(self) -> Optional[float]: + measurement_system = self.appliance.get_erd_value(ErdCode.TEMPERATURE_UNIT) + if measurement_system == ErdMeasurementUnits.METRIC: + targ = float(self.appliance.get_erd_value(self.target_temperature_erd_code)) + targ = round( ((targ - 32.0) * (5/9)) / 2 ) * 2 + return (9 * targ) / 5 + 32 return float(self.appliance.get_erd_value(self.target_temperature_erd_code)) @property def current_temperature(self) -> Optional[float]: + measurement_system = self.appliance.get_erd_value(ErdCode.TEMPERATURE_UNIT) + if measurement_system == ErdMeasurementUnits.METRIC: + current = float(self.appliance.get_erd_value(self.current_temperature_erd_code)) + current = round( (current - 32.0) * (5/9)) + return (9 * current) / 5 + 32 return float(self.appliance.get_erd_value(self.current_temperature_erd_code)) @property