Directly call write state 2 (#33513)

* Directly call async_write_ha_state pt2

* Directly call async_write_ha_state pt2

* Fix mock

* Address comments
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2020-04-03 09:34:50 +02:00
1 parent 83cc871edf
commit aef06a3544
40 files changed
+127 -117

No files matched your search

+1 -1
View File
@@ -271,7 +271,7 @@ async def async_setup(hass, config):
"""Update tokens of the entities."""
for entity in component.entities:
entity.async_update_token()
hass.async_create_task(entity.async_update_ha_state())
entity.async_write_ha_state()
hass.helpers.event.async_track_time_interval(update_tokens, TOKEN_CHANGE_INTERVAL)