Ensure a proper scope_id is given for IPv6 addresses when initializing the SSDP component (#86975)

fixes undefined
This commit is contained in:
Steven Looman 2023-01-30 22:14:48 +01:00 committed by GitHub
parent a8b23d7139
commit 50373500c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,7 +202,9 @@ async def async_build_source_set(hass: HomeAssistant) -> set[IPv4Address | IPv6A
return {
source_ip
for source_ip in await network.async_get_enabled_source_ips(hass)
if not source_ip.is_loopback and not source_ip.is_global
if not source_ip.is_loopback
and not source_ip.is_global
and (source_ip.version == 6 and source_ip.scope_id or source_ip.version == 4)
}