From 17536df7eafeaf19319cf5d3ece09d3bf2c473e5 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 29 Dec 2021 15:34:56 +0100 Subject: [PATCH] Fix Tuya data type information in climate (#62994) --- homeassistant/components/tuya/climate.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/tuya/climate.py b/homeassistant/components/tuya/climate.py index 83d635701db..35e6f5814f3 100644 --- a/homeassistant/components/tuya/climate.py +++ b/homeassistant/components/tuya/climate.py @@ -182,10 +182,10 @@ class TuyaClimateEntity(TuyaEntity, ClimateEntity): # it to define min, max & step temperatures if ( self._set_temperature_dpcode - and self._set_temperature_dpcode in device.status_range + and self._set_temperature_dpcode in device.function ): type_data = IntegerTypeData.from_json( - device.status_range[self._set_temperature_dpcode].values + device.function[self._set_temperature_dpcode].values ) self._attr_supported_features |= SUPPORT_TARGET_TEMPERATURE self._set_temperature_type = type_data @@ -232,14 +232,11 @@ class TuyaClimateEntity(TuyaEntity, ClimateEntity): ] # Determine dpcode to use for setting the humidity - if ( - DPCode.HUMIDITY_SET in device.status - and DPCode.HUMIDITY_SET in device.status_range - ): + if DPCode.HUMIDITY_SET in device.function: self._attr_supported_features |= SUPPORT_TARGET_HUMIDITY self._set_humidity_dpcode = DPCode.HUMIDITY_SET type_data = IntegerTypeData.from_json( - device.status_range[DPCode.HUMIDITY_SET].values + device.function[DPCode.HUMIDITY_SET].values ) self._set_humidity_type = type_data self._attr_min_humidity = int(type_data.min_scaled)