diff --git a/custom_components/localtuya/__init__.py b/custom_components/localtuya/__init__.py index a72b842f0..78a944307 100644 --- a/custom_components/localtuya/__init__.py +++ b/custom_components/localtuya/__init__.py @@ -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 ) diff --git a/custom_components/localtuya/climate.py b/custom_components/localtuya/climate.py index d8585ddaf..99bbf29ae 100644 --- a/custom_components/localtuya/climate.py +++ b/custom_components/localtuya/climate.py @@ -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."""