mirror of
https://github.com/home-assistant/core.git
synced 2025-11-10 11:29:46 +00:00
Hotfix deadlock on platform setup (#4354)
* Hotfix deadlock on platform setup * fix wrong import
This commit is contained in:
committed by
Paulus Schoutsen
parent
e73634e6c7
commit
71a305ea45
@@ -294,8 +294,12 @@ class EntityPlatform(object):
|
||||
|
||||
def add_entities(self, new_entities, update_before_add=False):
|
||||
"""Add entities for a single platform."""
|
||||
if update_before_add:
|
||||
for entity in new_entities:
|
||||
entity.update()
|
||||
|
||||
run_coroutine_threadsafe(
|
||||
self.async_add_entities(list(new_entities), update_before_add),
|
||||
self.async_add_entities(list(new_entities), False),
|
||||
self.component.hass.loop
|
||||
).result()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user