Avoid KeyError for ignored entries in async_step_zeroconf of Android TV Remote (#134250)

This commit is contained in:
tronikos 2024-12-30 00:13:51 -08:00 committed by GitHub
parent 1b06b4e45b
commit a7c2d96ecf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -156,7 +156,12 @@ class AndroidTVRemoteConfigFlow(ConfigFlow, domain=DOMAIN):
# and one of them, which could end up being in discovery_info.host, is from a
# different device. If any of the discovery_info.ip_addresses matches the
# existing host, don't update the host.
if existing_config_entry and len(discovery_info.ip_addresses) > 1:
if (
existing_config_entry
# Ignored entries don't have host
and CONF_HOST in existing_config_entry.data
and len(discovery_info.ip_addresses) > 1
):
existing_host = existing_config_entry.data[CONF_HOST]
if existing_host != self.host:
if existing_host in [