Convert switch to AsnycIO (#4382)
* Convert switch to AsnycIO * Move update entity to service * use time better for faster handling * Change to suggestion from paulus * Use new shedule_update_ha_state * fix lint * minimize executor calls
This commit is contained in:
1 parent
5d8a465c18
commit
41aaeb715a
18 files changed
+80
-56
No files matched your search
@@ -150,14 +150,14 @@ class WemoSwitch(SwitchDevice):
|
||||
def turn_on(self, **kwargs):
|
||||
"""Turn the switch on."""
|
||||
self._state = WEMO_ON
|
||||
self.update_ha_state()
|
||||
self.wemo.on()
|
||||
self.shedule_update_ha_state()
|
||||
|
||||
def turn_off(self):
|
||||
"""Turn the switch off."""
|
||||
self._state = WEMO_OFF
|
||||
self.update_ha_state()
|
||||
self.wemo.off()
|
||||
self.shedule_update_ha_state()
|
||||
|
||||
def update(self):
|
||||
"""Update WeMo state."""
|
||||
|
||||
Reference in new issue
Block a user