Merge branch 'master' into master

This commit is contained in:
Tim
2021-10-22 21:39:16 +10:30
committed by GitHub

View File

@@ -104,21 +104,17 @@ 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
return self._current_cover_position == 0
if self._current_cover_position == 0:
return True
if self._current_cover_position == 100:
return False
return None
async def async_set_cover_position(self, **kwargs):
"""Move the cover to a specific position."""