Procházet zdrojové kódy

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 před 1 rokem
rodič
revize
0e55258aa0
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  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