mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Add support for position on wink cover (#5751)
Add support for position property for wink covers and fix state when stopped in the middle.
This commit is contained in:
parent
4cc711357a
commit
32dc276c53
@ -40,13 +40,17 @@ class WinkCoverDevice(WinkDevice, CoverDevice):
|
|||||||
"""Open the shade."""
|
"""Open the shade."""
|
||||||
self.wink.set_state(1)
|
self.wink.set_state(1)
|
||||||
|
|
||||||
|
def set_cover_position(self, position, **kwargs):
|
||||||
|
"""Move the roller shutter to a specific position."""
|
||||||
|
self.wink.set_state(float(position)/100)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def current_cover_position(self):
|
||||||
|
"""Return the current position of roller shutter."""
|
||||||
|
return int(self.wink.state()*100)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_closed(self):
|
def is_closed(self):
|
||||||
"""Return if the cover is closed."""
|
"""Return if the cover is closed."""
|
||||||
state = self.wink.state()
|
state = self.wink.state()
|
||||||
if state == 0:
|
return bool(state == 0)
|
||||||
return True
|
|
||||||
elif state == 1:
|
|
||||||
return False
|
|
||||||
else:
|
|
||||||
return None
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user