Merge pull request #1476 from ncd7/climate-minmax-default-temp-when-in-F-fix
fix bug when climate entity is using default min/max temp and temp un…
This commit is contained in:
@@ -343,6 +343,10 @@ class LocaltuyaClimate(LocalTuyaEntity, ClimateEntity):
|
|||||||
"""Return the minimum temperature."""
|
"""Return the minimum temperature."""
|
||||||
if self.has_config(CONF_MIN_TEMP_DP):
|
if self.has_config(CONF_MIN_TEMP_DP):
|
||||||
return self.dps_conf(CONF_MIN_TEMP_DP)
|
return self.dps_conf(CONF_MIN_TEMP_DP)
|
||||||
|
# DEFAULT_MIN_TEMP is in C
|
||||||
|
if self.temperature_unit == TEMP_FAHRENHEIT:
|
||||||
|
return DEFAULT_MIN_TEMP * 1.8 + 32
|
||||||
|
else:
|
||||||
return DEFAULT_MIN_TEMP
|
return DEFAULT_MIN_TEMP
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -350,6 +354,10 @@ class LocaltuyaClimate(LocalTuyaEntity, ClimateEntity):
|
|||||||
"""Return the maximum temperature."""
|
"""Return the maximum temperature."""
|
||||||
if self.has_config(CONF_MAX_TEMP_DP):
|
if self.has_config(CONF_MAX_TEMP_DP):
|
||||||
return self.dps_conf(CONF_MAX_TEMP_DP)
|
return self.dps_conf(CONF_MAX_TEMP_DP)
|
||||||
|
# DEFAULT_MAX_TEMP is in C
|
||||||
|
if self.temperature_unit == TEMP_FAHRENHEIT:
|
||||||
|
return DEFAULT_MAX_TEMP * 1.8 + 32
|
||||||
|
else:
|
||||||
return DEFAULT_MAX_TEMP
|
return DEFAULT_MAX_TEMP
|
||||||
|
|
||||||
def status_updated(self):
|
def status_updated(self):
|
||||||
|
Reference in New Issue
Block a user