From 9389d1e5611f6e4607b44b881a45140b8040ab04 Mon Sep 17 00:00:00 2001 From: Sascha Sander Date: Fri, 18 Feb 2022 15:00:49 +0100 Subject: [PATCH] Correct current temperature for tuya thermostats (#66715) Co-authored-by: Franck Nijhof --- homeassistant/components/tuya/climate.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/homeassistant/components/tuya/climate.py b/homeassistant/components/tuya/climate.py index b4def6fb379..b70f81bc4d5 100644 --- a/homeassistant/components/tuya/climate.py +++ b/homeassistant/components/tuya/climate.py @@ -365,6 +365,13 @@ class TuyaClimateEntity(TuyaEntity, ClimateEntity): if temperature is None: return None + if self._current_temperature.scale == 0 and self._current_temperature.step != 1: + # The current temperature can have a scale of 0 or 1 and is used for + # rounding, Home Assistant doesn't need to round but we will always + # need to divide the value by 10^1 in case of 0 as scale. + # https://developer.tuya.com/en/docs/iot/shift-temperature-scale-follow-the-setting-of-app-account-center?id=Ka9qo7so58efq#title-7-Round%20values + temperature = temperature / 10 + return self._current_temperature.scale_value(temperature) @property