Fix blocking/stack trace with empty list (#4191)

This commit is contained in:
Pascal Vizeli authored and Paulus Schoutsen committed 2016-11-03 18:33:18 -07:00
1 parent ee5f228309
commit e5d69feb93
1 file changed
+4
@@ -296,6 +296,10 @@ class EntityPlatform(object):
tasks = [self._async_process_entity(entity, update_before_add)
for entity in new_entities]
# handle empty list from component/platform
if not tasks:
return
yield from asyncio.gather(*tasks, loop=self.component.hass.loop)
yield from self.component.async_update_group()