Selaa lähdekoodia

Climate: if no hvac_mode dps, return hvac_mode of None.

Was returning Auto, on the assumption that a valid mode is expected, but
this results in a Mode select dropdown being created in the new climate
UI, with no contents to select from.  Returning None seems to be expected
in this case.

Issue #1144
Jason Rumney 2 vuotta sitten
vanhempi
commit
82fa229ee7
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      custom_components/tuya_local/climate.py

+ 1 - 1
custom_components/tuya_local/climate.py

@@ -312,7 +312,7 @@ class TuyaLocalClimate(TuyaLocalEntity, ClimateEntity):
     def hvac_mode(self):
     def hvac_mode(self):
         """Return current HVAC mode."""
         """Return current HVAC mode."""
         if self._hvac_mode_dps is None:
         if self._hvac_mode_dps is None:
-            return HVACMode.AUTO
+            return None
         hvac_mode = self._hvac_mode_dps.get_value(self._device)
         hvac_mode = self._hvac_mode_dps.get_value(self._device)
         try:
         try:
             return HVACMode(hvac_mode) if hvac_mode else None
             return HVACMode(hvac_mode) if hvac_mode else None