Просмотр исходного кода

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 год назад
Родитель
Сommit
0e55258aa0
1 измененных файлов с 3 добавлено и 0 удалено
  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