Explorar o código

Water heater: fix condition for inclusion of current temperature

- Need underscore on member variable name.
- reformat to satisfy black
Jason Rumney %!s(int64=2) %!d(string=hai) anos
pai
achega
6d2ee54ee3
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      custom_components/tuya_local/water_heater.py

+ 5 - 1
custom_components/tuya_local/water_heater.py

@@ -104,7 +104,11 @@ class TuyaLocalWaterHeater(TuyaLocalEntity, WaterHeaterEntity):
         # represented, not a number of decimal places.
         return 1.0 / max(
             self._temperature_dps.scale(self._device),
-            self._current_temperature_dps.scale(self._device) if self.current_temperature_dps else 1.0,
+            (
+                self._current_temperature_dps.scale(self._device)
+                if self._current_temperature_dps
+                else 1.0
+            ),
         )
 
     @property