We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9008470 commit 8ac4e72Copy full SHA for 8ac4e72
roborock/roborock_future.py
@@ -14,8 +14,12 @@ def __init__(self, protocol: int):
14
self.fut: Future = Future()
15
self.loop = self.fut.get_loop()
16
17
+ def _resolve(self, item: tuple[Any, VacuumError | None]) -> None:
18
+ if not self.fut.cancelled():
19
+ self.fut.set_result(item)
20
+
21
def resolve(self, item: tuple[Any, VacuumError | None]) -> None:
- self.loop.call_soon_threadsafe(self.fut.set_result, item)
22
+ self.loop.call_soon_threadsafe(self._resolve, item)
23
24
async def async_get(self, timeout: float | int) -> tuple[Any, VacuumError | None]:
25
try:
0 commit comments