Cleanup and simplitfy the async state update (#9390)

* Cleanup and simplitfy the async state update

* Update test_entity.py
This commit is contained in:
Pascal Vizeli authored and GitHub committed 2017-09-12 10:01:03 +02:00
1 parent c84a099b0f
commit 90f9a6bc0a
47 files changed
+128 -102

No files matched your search

@@ -161,7 +161,7 @@ class BinarySensorTemplate(BinarySensorDevice):
def set_state():
"""Set state of template binary sensor."""
self._state = state
self.hass.async_add_job(self.async_update_ha_state())
self.async_schedule_update_ha_state()
# state without delay
if (state and not self._delay_on) or \