Merge branch 'vacuum_platform_new' of https://github.com/rikman122/localtuya into vacuum_platform_new

This commit is contained in:
rikman122
2021-11-08 20:35:50 +01:00

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."""