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:
parent
5d8a465c18
commit
41aaeb715a
18 changed files with 80 additions and 56 deletions
|
@ -156,7 +156,7 @@ class NetioSwitch(SwitchDevice):
|
|||
val[self.outlet - 1] = '1' if value else '0'
|
||||
self.netio.get('port list %s' % ''.join(val))
|
||||
self.netio.states[self.outlet - 1] = value
|
||||
self.update_ha_state()
|
||||
self.shedule_update_ha_state()
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue