1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-15 00:03:51 +01:00

Fix dashboard dns lookup delay

This commit is contained in:
J. Nick Koston
2025-09-11 18:22:16 -05:00
parent 4d3405340d
commit 519bc5ef9e
2 changed files with 9 additions and 3 deletions

View File

@@ -33,7 +33,9 @@ class DNSCache:
Returns None if not in cache, list of addresses if found.
"""
if expire_time_addresses := self._cache.get(hostname):
# Normalize hostname for consistent lookups
normalized = hostname.rstrip(".").lower()
if expire_time_addresses := self._cache.get(normalized):
expire_time, addresses = expire_time_addresses
if expire_time > now_monotonic and not isinstance(addresses, Exception):
return addresses