From afed45d5d0f7ea501924c6c51e1f24a78cf982ec Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 2 Jan 2024 06:58:00 -1000 Subject: [PATCH] Replace intersection with isdisjoint in apple_tv config flow (#106633) --- homeassistant/components/apple_tv/config_flow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/apple_tv/config_flow.py b/homeassistant/components/apple_tv/config_flow.py index 6a85ea1d1a8..fc65253fe43 100644 --- a/homeassistant/components/apple_tv/config_flow.py +++ b/homeassistant/components/apple_tv/config_flow.py @@ -127,7 +127,7 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): def _entry_unique_id_from_identifers(self, all_identifiers: set[str]) -> str | None: """Search existing entries for an identifier and return the unique id.""" for entry in self._async_current_entries(): - if all_identifiers.intersection( + if not all_identifiers.isdisjoint( entry.data.get(CONF_IDENTIFIERS, [entry.unique_id]) ): return entry.unique_id @@ -326,7 +326,7 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): existing_identifiers = set( entry.data.get(CONF_IDENTIFIERS, [entry.unique_id]) ) - if not all_identifiers.intersection(existing_identifiers): + if all_identifiers.isdisjoint(existing_identifiers): continue combined_identifiers = existing_identifiers | all_identifiers if entry.data.get(