Răsfoiți Sursa

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 an în urmă
părinte
comite
0e55258aa0
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  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."""
         """Return the current HVAC action."""
         if self._hvac_action_dps is None:
         if self._hvac_action_dps is None:
             return None
             return None
+        if self.hvac_mode is HVACMode.OFF:
+            return HVACAction.OFF
+
         action = self._hvac_action_dps.get_value(self._device)
         action = self._hvac_action_dps.get_value(self._device)
         try:
         try:
             return HVACAction(action) if action else None
             return HVACAction(action) if action else None