Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion homeassistant/helpers/entity_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ async def _async_add_entity(self, entity, update_before_add,
self.domain, self.platform_name, entity.unique_id,
suggested_object_id=suggested_object_id,
config_entry_id=config_entry_id,
device_id=device_id)
device_id=device_id,
known_object_ids=self.entities.keys())

if entry.disabled:
self.logger.info(
Expand Down
5 changes: 3 additions & 2 deletions homeassistant/helpers/entity_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def async_generate_entity_id(self, domain, suggested_object_id,
@callback
def async_get_or_create(self, domain, platform, unique_id, *,
suggested_object_id=None, config_entry_id=None,
device_id=None):
device_id=None, known_object_ids=None):
"""Get entity. Create if it doesn't exist."""
entity_id = self.async_get_entity_id(domain, platform, unique_id)
if entity_id:
Expand All @@ -126,7 +126,8 @@ def async_get_or_create(self, domain, platform, unique_id, *,
device_id=device_id)

entity_id = self.async_generate_entity_id(
domain, suggested_object_id or '{}_{}'.format(platform, unique_id))
domain, suggested_object_id or '{}_{}'.format(platform, unique_id),
known_object_ids)

entity = RegistryEntry(
entity_id=entity_id,
Expand Down