Skip to content

Commit

Permalink
Merge branch 'rospogrigio:master' into v5.2.1+
Browse files Browse the repository at this point in the history
  • Loading branch information
thecrisb authored Oct 4, 2023
2 parents 10d0b38 + e5009fd commit 7e990ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/localtuya/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ async def _async_reconnect(now):
_handle_reload,
)

hass.helpers.service.async_register_admin_service(
hass.services.async_register(
DOMAIN, SERVICE_SET_DP, _handle_set_dp, schema=SERVICE_SET_DP_SCHEMA
)

Expand Down
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 7e990ca

Please sign in to comment.