Migrate lock component to async (#5748)

This commit is contained in:
Pascal Vizeli 2017-02-06 21:25:34 +01:00 committed by GitHub
parent 32dc276c53
commit 2b124a008c
4 changed files with 58 additions and 26 deletions

View file

@ -43,9 +43,9 @@ class DemoLock(LockDevice):
def lock(self, **kwargs):
"""Lock the device."""
self._state = STATE_LOCKED
self.update_ha_state()
self.schedule_update_ha_state()
def unlock(self, **kwargs):
"""Unlock the device."""
self._state = STATE_UNLOCKED
self.update_ha_state()
self.schedule_update_ha_state()