mirror of
https://github.com/home-assistant/core.git
synced 2025-05-19 05:19:14 +00:00
improvements to zha cover (#31144)
This commit is contained in:
parent
217e280f8b
commit
e16e192b3c
@ -95,6 +95,16 @@ class ZhaCover(ZhaEntity, CoverDevice):
|
|||||||
return None
|
return None
|
||||||
return self.current_cover_position == 0
|
return self.current_cover_position == 0
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_opening(self):
|
||||||
|
"""Return if the cover is opening or not."""
|
||||||
|
return self._state == STATE_OPENING
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_closing(self):
|
||||||
|
"""Return if the cover is closing or not."""
|
||||||
|
return self._state == STATE_CLOSING
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_cover_position(self):
|
def current_cover_position(self):
|
||||||
"""Return the current position of ZHA cover.
|
"""Return the current position of ZHA cover.
|
||||||
@ -133,7 +143,7 @@ class ZhaCover(ZhaEntity, CoverDevice):
|
|||||||
|
|
||||||
async def async_set_cover_position(self, **kwargs):
|
async def async_set_cover_position(self, **kwargs):
|
||||||
"""Move the roller shutter to a specific position."""
|
"""Move the roller shutter to a specific position."""
|
||||||
new_pos = kwargs.get(ATTR_POSITION)
|
new_pos = kwargs[ATTR_POSITION]
|
||||||
res = await self._cover_channel.go_to_lift_percentage(100 - new_pos)
|
res = await self._cover_channel.go_to_lift_percentage(100 - new_pos)
|
||||||
if isinstance(res, list) and res[1] is Status.SUCCESS:
|
if isinstance(res, list) and res[1] is Status.SUCCESS:
|
||||||
self.async_set_state(
|
self.async_set_state(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user