Skip to content

Commit

Permalink
fix: ignore ping id during id check (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lash-L authored Jan 30, 2025
1 parent 4ed02e8 commit b3d74b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion roborock/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from .roborock_future import RoborockFuture
from .roborock_message import (
RoborockMessage,
RoborockMessageProtocol,
)
from .util import get_next_int

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

def _async_response(self, request_id: int, protocol_id: int = 0) -> Any:
queue = RoborockFuture(protocol_id)
if request_id in self._waiting_queue:
if request_id in self._waiting_queue and not (
request_id == 2 and protocol_id == RoborockMessageProtocol.PING_REQUEST
):
new_id = get_next_int(10000, 32767)
self._logger.warning(
"Attempting to create a future with an existing id %s (%s)... New id is %s. "
Expand Down

0 comments on commit b3d74b4

Please sign in to comment.