Browse Source

fix (valve): fix condition for handling switch dp

Jason Rumney 19 giờ trước cách đây
mục cha
commit
77cb320a24
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      custom_components/tuya_local/valve.py

+ 1 - 1
custom_components/tuya_local/valve.py

@@ -96,7 +96,7 @@ class TuyaLocalValve(TuyaLocalEntity, ValveEntity):
     @property
     def is_closed(self):
         """Report whether the valve is closed."""
-        if self._switch_dp self._switch_dp.get_value(self._device) is False:
+        if self._switch_dp and self._switch_dp.get_value(self._device) is False:
             return True
         pos = self._valve_dp.get_value(self._device)
         return not pos