Skip to content

Commit

Permalink
fix: wrong use of session close
Browse files Browse the repository at this point in the history
  • Loading branch information
topsworld committed Dec 21, 2024
1 parent 9116edf commit 4679a8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/xiaomi_home/miot/miot_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __init__(
self._session = aiohttp.ClientSession()

def __del__(self):
self._session.close()
self._main_loop.create_task(self._session.close())

def set_redirect_url(self, redirect_url: str) -> None:
if not isinstance(redirect_url, str) or redirect_url.strip() == '':
Expand Down Expand Up @@ -253,7 +253,7 @@ def __init__(
self._session = aiohttp.ClientSession()

def __del__(self):
self._session.close()
self._main_loop.create_task(self._session.close())

def update_http_header(
self, cloud_server: Optional[str] = None,
Expand Down

0 comments on commit 4679a8b

Please sign in to comment.