From f31b250fe2d528eb2aa03cbc81ee165129f9084d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 17 Oct 2023 14:05:39 -1000 Subject: [PATCH] Remove unless local variable in _connect_resolve_host (#588) --- aioesphomeapi/connection.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/aioesphomeapi/connection.py b/aioesphomeapi/connection.py index 2a3c82f..6433f11 100644 --- a/aioesphomeapi/connection.py +++ b/aioesphomeapi/connection.py @@ -277,13 +277,12 @@ class APIConnection: async def _connect_resolve_host(self) -> hr.AddrInfo: """Step 1 in connect process: resolve the address.""" try: - coro = hr.async_resolve_host( - self._params.address, - self._params.port, - self._params.zeroconf_instance, - ) async with asyncio_timeout(RESOLVE_TIMEOUT): - return await coro + return await hr.async_resolve_host( + self._params.address, + self._params.port, + self._params.zeroconf_instance, + ) except asyncio_TimeoutError as err: raise ResolveAPIError( f"Timeout while resolving IP address for {self.log_name}"