FHEM & reconnecting client fixes

This commit is contained in:
Martin Bauer
2019-07-07 17:30:45 +02:00
parent 06f96cb2dc
commit e6f5504181
8 changed files with 34 additions and 13 deletions

View File

@@ -58,6 +58,9 @@ class FhemCover(CoverDevice):
def current_cover_position(self):
return self._position
def refresh(self):
self.connection.fhem_set(self._ids[0], 'statusRequest')
@property
def is_closed(self):
"""Return if the cover is closed."""
@@ -88,8 +91,7 @@ class FhemCover(CoverDevice):
_, new_motor_state, new_position = line.split(':')
new_position = new_position.strip().lower()
new_motor_state = new_motor_state.strip().lower()
assert new_motor_state == 'stop' or new_motor_state == 'up' or new_motor_state == 'down', \
'Unknown motor state ' + new_motor_state
assert new_motor_state in ('up', 'down', 'stop', 'err'), 'Unknown motor state ' + new_motor_state
if new_motor_state == 'stop':
if new_position == 'on':
self._position = 100