Skip to content

Commit

Permalink
Update ge_climate.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve2Go authored and simbaja committed Jun 23, 2024
1 parent 48ea3b3 commit 6f8dab3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions custom_components/ge_home/entities/common/ge_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f8dab3

Please sign in to comment.