|
@@ -96,7 +96,7 @@ class TuyaLocalValve(TuyaLocalEntity, ValveEntity):
|
|
|
@property
|
|
@property
|
|
|
def is_closed(self):
|
|
def is_closed(self):
|
|
|
"""Report whether the valve is closed."""
|
|
"""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
|
|
return True
|
|
|
pos = self._valve_dp.get_value(self._device)
|
|
pos = self._valve_dp.get_value(self._device)
|
|
|
return not pos
|
|
return not pos
|