Skip to content

Commit

Permalink
Merge pull request #1476 from ncd7/climate-minmax-default-temp-when-i…
Browse files Browse the repository at this point in the history
…n-F-fix

fix bug when climate entity is using default min/max temp and temp un…
  • Loading branch information
rospogrigio authored Sep 22, 2023
2 parents 180b664 + 1c173d9 commit e5009fd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions custom_components/localtuya/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,22 @@ def min_temp(self):
"""Return the minimum temperature."""
if self.has_config(CONF_MIN_TEMP_DP):
return self.dps_conf(CONF_MIN_TEMP_DP)
return DEFAULT_MIN_TEMP
# DEFAULT_MIN_TEMP is in C
if self.temperature_unit == TEMP_FAHRENHEIT:
return DEFAULT_MIN_TEMP * 1.8 + 32
else:
return DEFAULT_MIN_TEMP

@property
def max_temp(self):
"""Return the maximum temperature."""
if self.has_config(CONF_MAX_TEMP_DP):
return self.dps_conf(CONF_MAX_TEMP_DP)
return DEFAULT_MAX_TEMP
# DEFAULT_MAX_TEMP is in C
if self.temperature_unit == TEMP_FAHRENHEIT:
return DEFAULT_MAX_TEMP * 1.8 + 32
else:
return DEFAULT_MAX_TEMP

def status_updated(self):
"""Device status was updated."""
Expand Down

0 comments on commit e5009fd

Please sign in to comment.