Fix for unknown state of covers/shutters

This commit is contained in:
rospogrigio
2023-01-12 19:14:55 +01:00
parent b9c0e5ee8d
commit c15fcaa9b8

View File

@@ -108,13 +108,13 @@ class LocaltuyaCover(LocalTuyaEntity, CoverEntity):
def is_closed(self): def is_closed(self):
"""Return if the cover is closed or not.""" """Return if the cover is closed or not."""
if self._config[CONF_POSITIONING_MODE] == COVER_MODE_NONE: if self._config[CONF_POSITIONING_MODE] == COVER_MODE_NONE:
return None return False
if self._current_cover_position == 0: if self._current_cover_position == 0:
return True return True
if self._current_cover_position == 100: if self._current_cover_position == 100:
return False return False
return None return False
async def async_set_cover_position(self, **kwargs): async def async_set_cover_position(self, **kwargs):
"""Move the cover to a specific position.""" """Move the cover to a specific position."""