Hotfix deadlock on platform setup (#4354)

* Hotfix deadlock on platform setup

* fix wrong import
This commit is contained in:
Pascal Vizeli
2016-11-13 01:19:13 +01:00
committed by Paulus Schoutsen
parent e73634e6c7
commit 71a305ea45
2 changed files with 30 additions and 1 deletions

View File

@@ -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()