Write state if schedule update state from async context (#31758)

* Write state if schedule update state from async context

* Fix most tests

* Fix test and PS4 I/O in event loop

* Fix ps4 better
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2020-02-13 10:22:06 -08:00
1 parent 8d1f8055dd
commit 9e7185c676
8 files changed
+16 -12

No files matched your search

+4 -1
View File
@@ -441,7 +441,10 @@ class Entity(ABC):
If state is changed more than once before the ha state change task has
been executed, the intermediate state transitions will be missed.
"""
self.hass.async_create_task(self.async_update_ha_state(force_refresh))
if force_refresh:
self.hass.async_create_task(self.async_update_ha_state(force_refresh))
else:
self.async_write_ha_state()
async def async_device_update(self, warning=True):
"""Process 'update' or 'async_update' from entity.