diff --git a/homeassistant/components/zha/core/gateway.py b/homeassistant/components/zha/core/gateway.py index c57c7269723..3a65787cd48 100644 --- a/homeassistant/components/zha/core/gateway.py +++ b/homeassistant/components/zha/core/gateway.py @@ -347,7 +347,8 @@ class ZHAGateway: remove_tasks = [] for entity_ref in entity_refs: remove_tasks.append(entity_ref.remove_future) - await asyncio.wait(remove_tasks) + 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: self.ha_device_registry.async_remove_device(reg_device.id)