Don't create repairs asking user to remove duplicate flipr config entries (#130058)

* Don't create repairs asking user to remove duplicate flipr config entries

* Improve comments
This commit is contained in:
Erik Montnemery
2024-11-07 17:38:10 +01:00
committed by GitHub
parent ef767c2b9f
commit 536e686892
2 changed files with 47 additions and 1 deletions

View File

@ -2158,7 +2158,12 @@ class ConfigEntries:
if unique_id is not UNDEFINED and entry.unique_id != unique_id:
# Deprecated in 2024.11, should fail in 2025.11
if (
unique_id is not None
# flipr creates duplicates during migration, and asks users to
# remove the duplicate. We don't need warn about it here too.
# We should remove the special case for "flipr" in HA Core 2025.4,
# when the flipr migration period ends
entry.domain != "flipr"
and unique_id is not None
and self.async_entry_for_domain_unique_id(entry.domain, unique_id)
is not None
):
@ -2436,6 +2441,12 @@ class ConfigEntries:
issues.add(issue.issue_id)
for domain, unique_ids in self._entries._domain_unique_id_index.items(): # noqa: SLF001
# flipr creates duplicates during migration, and asks users to
# remove the duplicate. We don't need warn about it here too.
# We should remove the special case for "flipr" in HA Core 2025.4,
# when the flipr migration period ends
if domain == "flipr":
continue
for unique_id, entries in unique_ids.items():
# We might mutate the list of entries, so we need a copy to not mess up
# the index