1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-01 01:22:20 +01:00

Fix DNS resolution inconsistency between logs and OTA operations (#10595)

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
This commit is contained in:
J. Nick Koston
2025-09-07 17:25:22 -05:00
committed by GitHub
parent b25506b045
commit 148fa698cc
6 changed files with 640 additions and 100 deletions

View File

@@ -308,8 +308,12 @@ def perform_ota(
time.sleep(1)
def run_ota_impl_(remote_host, remote_port, password, filename):
def run_ota_impl_(
remote_host: str | list[str], remote_port: int, password: str, filename: str
) -> int:
# Handle both single host and list of hosts
try:
# Resolve all hosts at once for parallel DNS resolution
res = resolve_ip_address(remote_host, remote_port)
except EsphomeError as err:
_LOGGER.error(
@@ -350,7 +354,9 @@ def run_ota_impl_(remote_host, remote_port, password, filename):
return 1
def run_ota(remote_host, remote_port, password, filename):
def run_ota(
remote_host: str | list[str], remote_port: int, password: str, filename: str
) -> int:
try:
return run_ota_impl_(remote_host, remote_port, password, filename)
except OTAError as err: