mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
handle cancellation
This commit is contained in:
parent
8e51fa7d31
commit
bd285a9fb0
@ -168,6 +168,12 @@ class TPLinkSmartHomeProtocol:
|
||||
_LOGGER.debug(
|
||||
"Unable to query the device %s, retrying: %s", self.host, ex
|
||||
)
|
||||
except BaseException as ex:
|
||||
# Likely something cancelled the task, so we need to close the connection
|
||||
await self.close()
|
||||
_LOGGER.debug(
|
||||
"BaseException during query, closing connection: %s", self.host, ex
|
||||
)
|
||||
|
||||
# make mypy happy, this should never be reached..
|
||||
await self.close()
|
||||
|
Loading…
Reference in New Issue
Block a user