Migrate cover to async. (#5717)

This commit is contained in:
Pascal Vizeli 2017-02-02 21:39:13 +01:00 committed by Paulus Schoutsen
parent bc65452efb
commit f63874eb8c
5 changed files with 110 additions and 32 deletions

View file

@ -151,7 +151,7 @@ class MqttCover(CoverDevice):
if self._optimistic:
# Optimistically assume that cover has changed state.
self._state = False
self.update_ha_state()
self.schedule_update_ha_state()
def close_cover(self, **kwargs):
"""Move the cover down."""
@ -160,7 +160,7 @@ class MqttCover(CoverDevice):
if self._optimistic:
# Optimistically assume that cover has changed state.
self._state = True
self.update_ha_state()
self.schedule_update_ha_state()
def stop_cover(self, **kwargs):
"""Stop the device."""