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:
@@ -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
|
||||
|
Reference in New Issue
Block a user