From f8694bae03415dd73e253b6d89175f723ef93310 Mon Sep 17 00:00:00 2001 From: Cambridge Yang Date: Fri, 6 Dec 2024 10:35:28 -0500 Subject: [PATCH] reset device_fut when timeout is reached --- findmy/scanner/scanner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/findmy/scanner/scanner.py b/findmy/scanner/scanner.py index 810abbf..c4bdd87 100644 --- a/findmy/scanner/scanner.py +++ b/findmy/scanner/scanner.py @@ -393,7 +393,8 @@ async def scan_for( yield device time_left = stop_at - time.time() - except (asyncio.CancelledError, asyncio.TimeoutError): # timeout reached + except asyncio.TimeoutError: # timeout reached + self._device_fut = self._loop.create_future() return finally: await self._stop_scan()