fix exception on device removal (#47803)

pull/47844/head
David F. Mulcahey 2021-03-12 21:06:37 -05:00 committed by GitHub
parent 2178e27fb4
commit 547fd7d352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -347,6 +347,7 @@ class ZHAGateway:
remove_tasks = []
for entity_ref in entity_refs:
remove_tasks.append(entity_ref.remove_future)
if remove_tasks:
await asyncio.wait(remove_tasks)
reg_device = self.ha_device_registry.async_get(device.device_id)
if reg_device is not None: