1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-03 11:52:20 +01:00

OTA: Fix IPv6 and multiple address support (#7414)

This commit is contained in:
David Woodhouse
2024-11-08 03:38:13 +00:00
committed by GitHub
parent 3f123d7542
commit 2f77d31690
5 changed files with 117 additions and 57 deletions

View File

@@ -182,8 +182,8 @@ class EsphomeZeroconf(Zeroconf):
if (
info.load_from_cache(self)
or (timeout and info.request(self, timeout * 1000))
) and (addresses := info.ip_addresses_by_version(IPVersion.V4Only)):
return str(addresses[0])
) and (addresses := info.parsed_scoped_addresses(IPVersion.All)):
return addresses
return None
@@ -194,6 +194,6 @@ class AsyncEsphomeZeroconf(AsyncZeroconf):
if (
info.load_from_cache(self.zeroconf)
or (timeout and await info.async_request(self.zeroconf, timeout * 1000))
) and (addresses := info.ip_addresses_by_version(IPVersion.V4Only)):
return str(addresses[0])
) and (addresses := info.parsed_scoped_addresses(IPVersion.All)):
return addresses
return None