Merge branch 'master' into vacuum_platform_new

This commit is contained in:
rospogrigio
2021-11-03 09:56:08 +01:00
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."""