1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-12 07:58:17 +00:00

Merge branch 'mdns_cache' into integration

This commit is contained in:
J. Nick Koston 2023-11-09 23:35:27 -06:00
commit 740ad21010
No known key found for this signature in database

View File

@ -993,7 +993,9 @@ class MDNSStatusThread(threading.Thread):
def resolve_host_thread_safe(self, host_name: str) -> str | None:
"""Resolve a host name to an address in a thread-safe manner."""
if zc := self.zeroconf:
return zc.resolve_host(host_name)
# Currently we do not do any I/O and only
# return the cached result (timeout=0)
return zc.resolve_host(host_name, 0)
return None
def _refresh_hosts(self):