fix cover state issue
This commit is contained in:
@@ -104,21 +104,16 @@ class LocaltuyaCover(LocalTuyaEntity, CoverEntity):
|
|||||||
state = self._state
|
state = self._state
|
||||||
return state == self._close_cmd
|
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
|
@property
|
||||||
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_POSITION:
|
if self._config[CONF_POSITIONING_MODE] == COVER_MODE_NONE:
|
||||||
return None
|
return None
|
||||||
|
elif self._current_cover_position == 0:
|
||||||
return self._current_cover_position == 0
|
return True
|
||||||
|
elif self._current_cover_position == 100:
|
||||||
|
return False
|
||||||
|
return None
|
||||||
|
|
||||||
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."""
|
||||||
|
Reference in New Issue
Block a user