Directly call async_write_ha_state (#33508)
* Directly call async_write_ha_state * Address comments * Fix tests
This commit is contained in:
1 parent
4e043b3123
commit
aaa1d06809
129 files changed
+263
-278
No files matched your search
@@ -283,7 +283,7 @@ class BinarySensorTemplate(BinarySensorDevice):
|
||||
def set_state():
|
||||
"""Set state of template binary sensor."""
|
||||
self._state = state
|
||||
self.async_schedule_update_ha_state()
|
||||
self.async_write_ha_state()
|
||||
|
||||
# state without delay
|
||||
if (state and not self._delay_on) or (not state and not self._delay_off):
|
||||
|
||||
Reference in new issue
Block a user