Correct current temperature for tuya thermostats (#66715)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>pull/66814/head
parent
56d45c49e9
commit
9389d1e561
homeassistant/components/tuya
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue