Sfoglia il codice sorgente

climate: always return OFF for action when the mode is off.

This should allow simplification of some configs, as the off switch
no longer needs to be considered in the config.

This may also free up the constraint to be used for more complex reporting.
Jason Rumney 1 anno fa
parent
commit
0e55258aa0
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      custom_components/tuya_local/climate.py

+ 3 - 0
custom_components/tuya_local/climate.py

@@ -314,6 +314,9 @@ class TuyaLocalClimate(TuyaLocalEntity, ClimateEntity):
         """Return the current HVAC action."""
         if self._hvac_action_dps is None:
             return None
+        if self.hvac_mode is HVACMode.OFF:
+            return HVACAction.OFF
+
         action = self._hvac_action_dps.get_value(self._device)
         try:
             return HVACAction(action) if action else None