Skip to content

Commit 39fd964

Browse files
fix: cloud_api.py
1 parent 291a6b2 commit 39fd964

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

roborock/cloud_api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import secrets
66
import threading
77
from asyncio import Lock
8-
from typing import Any, Callable
8+
from typing import Any
99
from urllib.parse import urlparse
1010

1111
import paho.mqtt.client as mqtt
@@ -22,7 +22,7 @@
2222
)
2323
from .roborock_queue import RoborockQueue
2424
from .typing import (
25-
RoborockCommand, RoborockDeviceProp,
25+
RoborockCommand, RoborockDeviceProp, RoborockDeviceInfo,
2626
)
2727
from .util import run_in_executor
2828

@@ -34,10 +34,10 @@
3434
class RoborockMqttClient(RoborockClient, mqtt.Client):
3535
_thread: threading.Thread
3636

37-
def __init__(self, user_data: UserData, device_localkey: dict[str, str]) -> None:
37+
def __init__(self, user_data: UserData, devices_info: dict[str, RoborockDeviceInfo]) -> None:
3838
rriot = user_data.rriot
3939
endpoint = base64.b64encode(md5bin(rriot.endpoint)[8:14]).decode()
40-
RoborockClient.__init__(self, endpoint, device_localkey)
40+
RoborockClient.__init__(self, endpoint, devices_info)
4141
mqtt.Client.__init__(self, protocol=mqtt.MQTTv5)
4242
self._mqtt_user = rriot.user
4343
self._hashed_user = md5hex(self._mqtt_user + ":" + rriot.endpoint)[2:10]
@@ -192,7 +192,7 @@ async def send_command(
192192
_LOGGER.debug(f"id={request_id} Requesting method {method} with {params}")
193193
request_protocol = 101
194194
response_protocol = 301 if method in SPECIAL_COMMANDS else 102
195-
msg = super()._encode_msg(device_id, request_protocol, timestamp, payload)
195+
msg = super()._encode_msg(device_id, request_id, request_protocol, timestamp, payload)
196196
self._send_msg_raw(device_id, msg)
197197
(response, err) = await self._async_response(request_id, response_protocol)
198198
if err:

0 commit comments

Comments
 (0)