python-roborock 2.8.3__tar.gz → 2.8.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. {python_roborock-2.8.3 → python_roborock-2.8.5}/PKG-INFO +2 -2
  2. {python_roborock-2.8.3 → python_roborock-2.8.5}/pyproject.toml +1 -1
  3. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/api.py +10 -16
  4. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/code_mappings.py +7 -3
  5. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/version_1_apis/roborock_client_v1.py +7 -1
  6. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/version_1_apis/roborock_local_client_v1.py +1 -0
  7. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/version_1_apis/roborock_mqtt_client_v1.py +1 -0
  8. {python_roborock-2.8.3 → python_roborock-2.8.5}/LICENSE +0 -0
  9. {python_roborock-2.8.3 → python_roborock-2.8.5}/README.md +0 -0
  10. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/__init__.py +0 -0
  11. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/cli.py +0 -0
  12. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/cloud_api.py +0 -0
  13. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/command_cache.py +0 -0
  14. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/const.py +0 -0
  15. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/containers.py +1 -1
  16. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/exceptions.py +0 -0
  17. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/local_api.py +0 -0
  18. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/protocol.py +0 -0
  19. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/py.typed +0 -0
  20. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/roborock_future.py +0 -0
  21. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/roborock_message.py +0 -0
  22. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/roborock_typing.py +0 -0
  23. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/util.py +0 -0
  24. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/version_1_apis/__init__.py +0 -0
  25. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/version_a01_apis/__init__.py +0 -0
  26. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/version_a01_apis/roborock_client_a01.py +0 -0
  27. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/version_a01_apis/roborock_mqtt_client_a01.py +0 -0
  28. {python_roborock-2.8.3 → python_roborock-2.8.5}/roborock/web_api.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: python-roborock
3
- Version: 2.8.3
3
+ Version: 2.8.5
4
4
  Summary: A package to control Roborock vacuums.
5
5
  Home-page: https://github.com/humbertogontijo/python-roborock
6
6
  License: GPL-3.0-only
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-roborock"
3
- version = "2.8.3"
3
+ version = "2.8.5"
4
4
  description = "A package to control Roborock vacuums."
5
5
  authors = ["humbertogontijo <humbertogontijo@users.noreply.github.com>"]
6
6
  license = "GPL-3.0-only"
@@ -7,7 +7,7 @@ import base64
7
7
  import logging
8
8
  import secrets
9
9
  import time
10
- from collections.abc import Callable, Coroutine
10
+ from collections.abc import Coroutine
11
11
  from typing import Any
12
12
 
13
13
  from .containers import (
@@ -36,8 +36,8 @@ class RoborockClient:
36
36
  self._endpoint = endpoint
37
37
  self._nonce = secrets.token_bytes(16)
38
38
  self._waiting_queue: dict[int, RoborockFuture] = {}
39
- self._last_device_msg_in = self.time_func()
40
- self._last_disconnection = self.time_func()
39
+ self._last_device_msg_in = time.monotonic()
40
+ self._last_disconnection = time.monotonic()
41
41
  self.keep_alive = KEEPALIVE
42
42
  self._diagnostic_data: dict[str, dict[str, Any]] = {
43
43
  "misc_info": {"Nonce": base64.b64encode(self._nonce).decode("utf-8")}
@@ -59,15 +59,6 @@ class RoborockClient:
59
59
  def diagnostic_data(self) -> dict:
60
60
  return self._diagnostic_data
61
61
 
62
- @property
63
- def time_func(self) -> Callable[[], float]:
64
- try:
65
- # Use monotonic clock if available
66
- time_func = time.monotonic
67
- except AttributeError:
68
- time_func = time.time
69
- return time_func
70
-
71
62
  async def async_connect(self):
72
63
  raise NotImplementedError
73
64
 
@@ -81,13 +72,13 @@ class RoborockClient:
81
72
  raise NotImplementedError
82
73
 
83
74
  def on_connection_lost(self, exc: Exception | None) -> None:
84
- self._last_disconnection = self.time_func()
75
+ self._last_disconnection = time.monotonic()
85
76
  self._logger.info("Roborock client disconnected")
86
77
  if exc is not None:
87
78
  self._logger.warning(exc)
88
79
 
89
80
  def should_keepalive(self) -> bool:
90
- now = self.time_func()
81
+ now = time.monotonic()
91
82
  # noinspection PyUnresolvedReferences
92
83
  if now - self._last_disconnection > self.keep_alive**2 and now - self._last_device_msg_in > self.keep_alive:
93
84
  return False
@@ -116,8 +107,11 @@ class RoborockClient:
116
107
  if request_id in self._waiting_queue:
117
108
  new_id = get_next_int(10000, 32767)
118
109
  _LOGGER.warning(
119
- f"Attempting to create a future with an existing request_id... New id is {new_id}. "
120
- f"Code may not function properly."
110
+ "Attempting to create a future with an existing id %s (%s)... New id is %s. "
111
+ "Code may not function properly.",
112
+ request_id,
113
+ protocol_id,
114
+ new_id,
121
115
  )
122
116
  request_id = new_id
123
117
  self._waiting_queue[request_id] = queue
@@ -244,12 +244,14 @@ class RoborockFanSpeedQ7Max(RoborockFanPowerCode):
244
244
 
245
245
 
246
246
  class RoborockFanSpeedQRevoMaster(RoborockFanPowerCode):
247
+ off = 105
247
248
  quiet = 101
248
249
  balanced = 102
249
250
  turbo = 103
250
251
  max = 104
251
- max_plus = 105
252
- custom = 110 # Smartplan
252
+ custom = 106
253
+ max_plus = 108
254
+ smart_mode = 110
253
255
 
254
256
 
255
257
  class RoborockFanSpeedP10(RoborockFanPowerCode):
@@ -344,8 +346,9 @@ class RoborockMopIntensityQRevoMaster(RoborockMopIntensityCode):
344
346
  low = 201
345
347
  medium = 202
346
348
  high = 203
349
+ custom = 204
347
350
  custom_water_flow = 207
348
- custom = 209 # SmartPlan
351
+ smart_mode = 209
349
352
 
350
353
 
351
354
  class RoborockMopIntensityP10(RoborockMopIntensityCode):
@@ -426,6 +429,7 @@ class RoborockDockTypeCode(RoborockEnum):
426
429
  p10_dock = 8
427
430
  p10_pro_dock = 9
428
431
  s8_maxv_ultra_dock = 10
432
+ qrevo_master_dock = 14
429
433
  qrevo_s_dock = 15
430
434
 
431
435
 
@@ -361,7 +361,7 @@ class RoborockClientV1(RoborockClient):
361
361
 
362
362
  def on_message_received(self, messages: list[RoborockMessage]) -> None:
363
363
  try:
364
- self._last_device_msg_in = self.time_func()
364
+ self._last_device_msg_in = time.monotonic()
365
365
  for data in messages:
366
366
  protocol = data.protocol
367
367
  if data.payload and protocol in [
@@ -391,6 +391,8 @@ class RoborockClientV1(RoborockClient):
391
391
  if isinstance(result, list) and len(result) == 1:
392
392
  result = result[0]
393
393
  queue.resolve((result, None))
394
+ else:
395
+ self._logger.debug("Received response for unknown request id %s", request_id)
394
396
  else:
395
397
  try:
396
398
  data_protocol = RoborockDataProtocol(int(data_point_number))
@@ -443,10 +445,14 @@ class RoborockClientV1(RoborockClient):
443
445
  if isinstance(decompressed, list):
444
446
  decompressed = decompressed[0]
445
447
  queue.resolve((decompressed, None))
448
+ else:
449
+ self._logger.debug("Received response for unknown request id %s", request_id)
446
450
  else:
447
451
  queue = self._waiting_queue.get(data.seq)
448
452
  if queue:
449
453
  queue.resolve((data.payload, None))
454
+ else:
455
+ self._logger.debug("Received response for unknown request id %s", data.seq)
450
456
  except Exception as ex:
451
457
  self._logger.exception(ex)
452
458
 
@@ -18,6 +18,7 @@ class RoborockLocalClientV1(RoborockLocalClient, RoborockClientV1):
18
18
  ) -> RoborockMessage:
19
19
  secured = True if method in COMMANDS_SECURED else False
20
20
  request_id, timestamp, payload = self._get_payload(method, params, secured)
21
+ self._logger.debug("Building message id %s for method %s", request_id, method)
21
22
  request_protocol = RoborockMessageProtocol.GENERAL_REQUEST
22
23
  message_retry: MessageRetry | None = None
23
24
  if method == RoborockCommand.RETRY_REQUEST and isinstance(params, dict):
@@ -74,6 +74,7 @@ class RoborockMqttClientV1(RoborockMqttClient, RoborockClientV1):
74
74
  # When we have more custom commands do something more complicated here
75
75
  return await self._get_calibration_points()
76
76
  request_id, timestamp, payload = self._get_payload(method, params, True)
77
+ self._logger.debug("Building message id %s for method %s", request_id, method)
77
78
  request_protocol = RoborockMessageProtocol.RPC_REQUEST
78
79
  roborock_message = RoborockMessage(timestamp=timestamp, protocol=request_protocol, payload=payload)
79
80
  return await self.send_message(roborock_message)
File without changes
@@ -36,10 +36,10 @@ from .code_mappings import (
36
36
  RoborockMopIntensityS7,
37
37
  RoborockMopIntensityS8MaxVUltra,
38
38
  RoborockMopModeCode,
39
+ RoborockMopModeQRevoMaster,
39
40
  RoborockMopModeS7,
40
41
  RoborockMopModeS8MaxVUltra,
41
42
  RoborockMopModeS8ProUltra,
42
- RoborockMopModeQRevoMaster,
43
43
  RoborockStartType,
44
44
  RoborockStateCode,
45
45
  )