From 3bd12fcef6afb25d7cbf76191f320571f7af01f7 Mon Sep 17 00:00:00 2001 From: Toon Willems Date: Tue, 4 Sep 2018 11:15:02 +0200 Subject: [PATCH] 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 --- homeassistant/components/cover/rflink.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/cover/rflink.py b/homeassistant/components/cover/rflink.py index e50fa488b92..41a4c2af045 100644 --- a/homeassistant/components/cover/rflink.py +++ b/homeassistant/components/cover/rflink.py @@ -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."""