diff --git a/homeassistant/helpers/entity_platform.py b/homeassistant/helpers/entity_platform.py index 1acb3eaaec4..29381fee9a6 100644 --- a/homeassistant/helpers/entity_platform.py +++ b/homeassistant/helpers/entity_platform.py @@ -864,6 +864,8 @@ class EntityPlatform: ) entity.add_to_platform_abort() return + + entity.device_entry = device else: device = entity.device_entry else: @@ -924,8 +926,6 @@ class EntityPlatform: ) entity.registry_entry = entry - if device: - entity.device_entry = device entity.entity_id = entry.entity_id else: # entity.unique_id is None