Make close behaviour consistent across new protocols and transports (#660)

This commit is contained in:
Steven B
2024-01-20 12:35:05 +00:00
committed by GitHub
parent e94cd118a4
commit 49cfef087c
4 changed files with 46 additions and 9 deletions

View File

@@ -66,8 +66,8 @@ class SmartProtocol(TPLinkProtocol):
try:
return await self._execute_query(request, retry)
except ConnectionException as sdex:
await self.close()
if retry >= retry_count:
await self.close()
_LOGGER.debug("Giving up on %s after %s retries", self._host, retry)
raise sdex
continue
@@ -78,8 +78,8 @@ class SmartProtocol(TPLinkProtocol):
)
raise auex
except RetryableException as ex:
await self.close()
if retry >= retry_count:
await self.close()
_LOGGER.debug("Giving up on %s after %s retries", self._host, retry)
raise ex
continue