Skip to content

Commit 685edc8

Browse files
authored
fix: remove methods no longer available in paho-mqtt (#298)
1 parent ab7ffb3 commit 685edc8

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

roborock/cloud_api.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import logging
44
import threading
5-
import uuid
65
from abc import ABC
76
from asyncio import Lock
87
from typing import Any
@@ -29,16 +28,10 @@ class _Mqtt(mqtt.Client):
2928
"""
3029

3130
_thread: threading.Thread
32-
_client_id: str
3331

3432
def __init__(self) -> None:
3533
"""Initialize the MQTT client."""
3634
super().__init__(protocol=mqtt.MQTTv5)
37-
self.reset_client_id()
38-
39-
def reset_client_id(self):
40-
"""Generate a new client id to make a new session when reconnecting."""
41-
self._client_id = mqtt.base62(uuid.uuid4().int, padding=22)
4235

4336
def maybe_restart_loop(self) -> None:
4437
"""Ensure that the MQTT loop is running in case it previously exited."""
@@ -116,8 +109,6 @@ def _mqtt_on_disconnect(self, *args, **kwargs):
116109
try:
117110
exc = RoborockException(mqtt.error_string(rc)) if rc != mqtt.MQTT_ERR_SUCCESS else None
118111
super().on_connection_lost(exc)
119-
if rc == mqtt.MQTT_ERR_PROTOCOL:
120-
self._mqtt_client.reset_client_id()
121112
connection_queue = self._waiting_queue.get(DISCONNECT_REQUEST_ID)
122113
if connection_queue:
123114
connection_queue.set_result(True)

0 commit comments

Comments
 (0)