Workaround for HA Rounding on target temp

HA rounds incorrectly giving numbers for target temp such as 23.9, 24.4 etc, which doesn't match the display on the AC.

This converts back and forth to make the numbers match & make sense.
This commit is contained in:
Steve2Go 2024-03-31 18:59:36 +10:00 committed by GitHub
parent db011eada4
commit 072ab44df6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -94,7 +94,12 @@ class GeClimate(GeEntity, ClimateEntity):
@property
def target_temperature(self) -> Optional[float]:
return float(self.appliance.get_erd_value(self.target_temperature_erd_code))
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]: