Skip to content

Commit dc8e8a9

Browse files
committed
chore: remove extra exception
1 parent 26a9062 commit dc8e8a9

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

roborock/cloud_api.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from .api import KEEPALIVE, RoborockClient
1616
from .containers import DeviceData, UserData
17-
from .exceptions import RoborockException, RoborockInvalidUserData, VacuumError
17+
from .exceptions import RoborockException, VacuumError
1818
from .protocol import (
1919
Decoder,
2020
Encoder,
@@ -96,14 +96,7 @@ def _mqtt_on_connect(
9696
message = f"Failed to connect ({rc})"
9797
self._logger.error(message)
9898
if connection_queue:
99-
# These are the ReasonCodes relating to authorization issues.
100-
if rc.value in {24, 25, 133, 134, 135, 144}:
101-
connection_queue.set_exception(
102-
RoborockInvalidUserData("Failed to connect to mqtt. Invalid user data. Re-auth is needed.")
103-
)
104-
else:
105-
connection_queue.set_exception(VacuumError(message))
106-
else:
99+
connection_queue.set_exception(VacuumError(message))
107100
self._logger.debug("Failed to notify connect future, not in queue")
108101
return
109102
self._logger.info(f"Connected to mqtt {self._mqtt_host}:{self._mqtt_port}")

roborock/exceptions.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,3 @@ class RoborockTooManyRequest(RoborockException):
7777

7878
class RoborockRateLimit(RoborockException):
7979
"""Class for our rate limits exceptions."""
80-
81-
82-
class RoborockInvalidUserData(RoborockException):
83-
"""Class to state the user data is invalid (expired or manipulated)."""

roborock/roborock_future.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import async_timeout
77

8-
from .exceptions import RoborockInvalidUserData, VacuumError
8+
from .exceptions import VacuumError
99

1010

1111
class RoborockFuture:
@@ -21,11 +21,11 @@ def _set_result(self, item: Any) -> None:
2121
def set_result(self, item: Any) -> None:
2222
self.loop.call_soon_threadsafe(self._set_result, item)
2323

24-
def _set_exception(self, exc: VacuumError | RoborockInvalidUserData) -> None:
24+
def _set_exception(self, exc: VacuumError) -> None:
2525
if not self.fut.cancelled():
2626
self.fut.set_exception(exc)
2727

28-
def set_exception(self, exc: VacuumError | RoborockInvalidUserData) -> None:
28+
def set_exception(self, exc: VacuumError) -> None:
2929
self.loop.call_soon_threadsafe(self._set_exception, exc)
3030

3131
async def async_get(self, timeout: float | int) -> tuple[Any, VacuumError | None]:

0 commit comments

Comments
 (0)