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

This commit is contained in:
Pascal Vizeli 2016-11-04 02:33:18 +01:00 committed by Paulus Schoutsen
parent ee5f228309
commit e5d69feb93

View file

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