Просмотр исходного кода

climate: consider current_temperature for precision as well.

The only reason for this to differ from temperature_step would be if it is
for current_temperature rather than temperature.  So take that into
consideration, returning the higher precision of the two.
Issue #370
Jason Rumney 3 лет назад
Родитель
Сommit
c3ac744a4d
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      custom_components/tuya_local/climate.py

+ 4 - 1
custom_components/tuya_local/climate.py

@@ -132,7 +132,10 @@ class TuyaLocalClimate(TuyaLocalEntity, ClimateEntity):
         """Return the precision of the temperature setting."""
         # unlike sensor, this is a decimal of the smallest unit that can be
         # represented, not a number of decimal places.
-        return 1.0 / self._temperature_dps.scale(self._device)
+        return 1.0 / max(
+            self._temperature_dps.scale(self._device),
+            self._current_temperature_dps.scale(self._device),
+        )
 
     @property
     def target_temperature(self):