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:
Pascal Vizeli authored and Paulus Schoutsen committed 2016-11-15 21:06:50 -08:00
1 parent 5d8a465c18
commit 41aaeb715a
18 files changed
+80 -56

No files matched your search

@@ -170,7 +170,7 @@ class PALoopbackSwitch(SwitchDevice):
self._pa_svr.update_module_state(no_throttle=True)
self._module_idx = self._pa_svr.get_module_idx(
self._sink_name, self._source_name)
self.update_ha_state()
self.shedule_update_ha_state()
else:
_LOGGER.warning(IGNORED_SWITCH_WARN)
@@ -181,7 +181,7 @@ class PALoopbackSwitch(SwitchDevice):
self._pa_svr.update_module_state(no_throttle=True)
self._module_idx = self._pa_svr.get_module_idx(
self._sink_name, self._source_name)
self.update_ha_state()
self.shedule_update_ha_state()
else:
_LOGGER.warning(IGNORED_SWITCH_WARN)