Skip to content

Commit

Permalink
fix: cancel miot http timer
Browse files Browse the repository at this point in the history
  • Loading branch information
topsworld committed Dec 22, 2024
1 parent 8429899 commit 4e8361d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions custom_components/xiaomi_home/miot/miot_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,13 @@ def __init__(
self._session = aiohttp.ClientSession(loop=self._main_loop)

async def deinit_async(self) -> None:
if self._get_prop_timer:
self._get_prop_timer.cancel()
self._get_prop_timer = None
for item in self._get_prop_list.values():
fut: asyncio.Future = item.get('fut')
fut.cancel()
self._get_prop_list.clear()
if self._session and not self._session.closed:
await self._session.close()

Expand Down

0 comments on commit 4e8361d

Please sign in to comment.