Implement correct state for RFlink cover (#16304)

* implement correct state for rflink cover

* Fix linting error

* invert logic as local testing pointed out it should be reversed

* add period at the end to satisfy the linter
This commit is contained in:
Toon Willems 2018-09-04 11:15:02 +02:00 committed by Paulus Schoutsen
parent 85658b6dd1
commit 3bd12fcef6

View file

@ -92,9 +92,9 @@ class RflinkCover(RflinkCommand, CoverDevice):
self.cancel_queued_send_commands()
command = event['command']
if command in ['on', 'allon']:
if command in ['on', 'allon', 'up']:
self._state = True
elif command in ['off', 'alloff']:
elif command in ['off', 'alloff', 'down']:
self._state = False
@property
@ -105,7 +105,12 @@ class RflinkCover(RflinkCommand, CoverDevice):
@property
def is_closed(self):
"""Return if the cover is closed."""
return None
return not self._state
@property
def assumed_state(self):
"""Return True because covers can be stopped midway."""
return True
def async_close_cover(self, **kwargs):
"""Turn the device close."""