fix cover state issue

This commit is contained in:
regevbr
2021-09-30 10:43:03 +03:00
committed by rospogrigio
parent 363d76372c
commit 5e71ee4ae8

View File

@@ -104,21 +104,16 @@ class LocaltuyaCover(LocalTuyaEntity, CoverEntity):
state = self._state
return state == self._close_cmd
@property
def is_open(self):
"""Return if the cover is open or not."""
if self._config[CONF_POSITIONING_MODE] != COVER_MODE_POSITION:
return None
return self._current_cover_position == 100
@property
def is_closed(self):
"""Return if the cover is closed or not."""
if self._config[CONF_POSITIONING_MODE] != COVER_MODE_POSITION:
if self._config[CONF_POSITIONING_MODE] == COVER_MODE_NONE:
return None
elif self._current_cover_position == 0:
return True
elif self._current_cover_position == 100:
return False
return None
return self._current_cover_position == 0
async def async_set_cover_position(self, **kwargs):
"""Move the cover to a specific position."""