Skip to content

Commit b3d74b4

Browse files
authored
fix: ignore ping id during id check (#316)
1 parent 4ed02e8 commit b3d74b4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

roborock/api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from .roborock_future import RoborockFuture
2121
from .roborock_message import (
2222
RoborockMessage,
23+
RoborockMessageProtocol,
2324
)
2425
from .util import get_next_int
2526

@@ -101,7 +102,9 @@ async def _wait_response(self, request_id: int, queue: RoborockFuture) -> Any:
101102

102103
def _async_response(self, request_id: int, protocol_id: int = 0) -> Any:
103104
queue = RoborockFuture(protocol_id)
104-
if request_id in self._waiting_queue:
105+
if request_id in self._waiting_queue and not (
106+
request_id == 2 and protocol_id == RoborockMessageProtocol.PING_REQUEST
107+
):
105108
new_id = get_next_int(10000, 32767)
106109
self._logger.warning(
107110
"Attempting to create a future with an existing id %s (%s)... New id is %s. "

0 commit comments

Comments
 (0)