python-roborock 0.24.1__tar.gz → 0.25.2__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.
@@ -1,30 +1,30 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-roborock
3
- Version: 0.24.1
3
+ Version: 0.25.2
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
7
7
  Author: humbertogontijo
8
8
  Author-email: humbertogontijo@users.noreply.github.com
9
- Requires-Python: >=3.9,<4.0
9
+ Requires-Python: >=3.10,<4.0
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
13
13
  Classifier: Natural Language :: English
14
14
  Classifier: Operating System :: OS Independent
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.9
17
16
  Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
19
18
  Classifier: Topic :: Software Development :: Libraries
20
19
  Requires-Dist: aiohttp (>=3.8.2,<4.0.0)
20
+ Requires-Dist: alexapy (>=1.26.8,<2.0.0)
21
21
  Requires-Dist: async-timeout
22
22
  Requires-Dist: click (>=8)
23
- Requires-Dist: construct (>=2.10.56,<3.0.0)
23
+ Requires-Dist: construct (>=2.10.68,<3.0.0)
24
24
  Requires-Dist: dacite (>=1.8.0,<1.9.0)
25
25
  Requires-Dist: paho-mqtt (>=1.6.1,<1.7.0)
26
- Requires-Dist: pycryptodome (>=3.17.0,<3.18.0)
27
- Requires-Dist: pycryptodomex (>=3.17.0,<3.18.0) ; sys_platform == "darwin"
26
+ Requires-Dist: pycryptodome (>=3.17,<3.19)
27
+ Requires-Dist: pycryptodomex (>=3.17,<3.19) ; sys_platform == "darwin"
28
28
  Project-URL: Repository, https://github.com/humbertogontijo/python-roborock
29
29
  Description-Content-Type: text/markdown
30
30
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-roborock"
3
- version = "0.24.1"
3
+ version = "0.25.2"
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"
@@ -19,15 +19,16 @@ packages = [{include = "roborock"}]
19
19
  roborock = "roborock.cli:main"
20
20
 
21
21
  [tool.poetry.dependencies]
22
- python = "^3.9"
22
+ python = "^3.10"
23
23
  click = ">=8"
24
24
  aiohttp = "^3.8.2"
25
25
  async-timeout = "*"
26
- pycryptodome = "~3.17.0"
27
- pycryptodomex = {version = "~3.17.0", markers = "sys_platform == 'darwin'"}
26
+ pycryptodome = ">=3.17,<3.19"
27
+ pycryptodomex = {version = ">=3.17,<3.19", markers = "sys_platform == 'darwin'"}
28
28
  paho-mqtt = "~1.6.1"
29
29
  dacite = "~1.8.0"
30
- construct = "^2.10.56"
30
+ construct = "^2.10.68"
31
+ alexapy = "^1.26.8"
31
32
 
32
33
 
33
34
  [build-system]
@@ -103,6 +103,8 @@ class RoborockClient:
103
103
  self._last_disconnection = self.time_func()
104
104
  self.keep_alive = KEEPALIVE
105
105
  self._diagnostic_data: dict[str, dict[str, Any]] = {}
106
+ self.dnd_timer: DnDTimer | None = None
107
+ self.valley_timer: ValleyElectricityTimer | None = None
106
108
 
107
109
  def __del__(self) -> None:
108
110
  self.sync_disconnect()
@@ -255,11 +257,19 @@ class RoborockClient:
255
257
 
256
258
  @fallback_cache
257
259
  async def get_dnd_timer(self) -> DnDTimer | None:
258
- return await self.send_command(RoborockCommand.GET_DND_TIMER, return_type=DnDTimer)
260
+ result = await self.send_command(RoborockCommand.GET_DND_TIMER, return_type=DnDTimer)
261
+ if result is not None:
262
+ self.dnd_timer = result
263
+ return result
259
264
 
260
265
  @fallback_cache
261
266
  async def get_valley_electricity_timer(self) -> ValleyElectricityTimer | None:
262
- return await self.send_command(RoborockCommand.GET_VALLEY_ELECTRICITY_TIMER, return_type=ValleyElectricityTimer)
267
+ result = await self.send_command(
268
+ RoborockCommand.GET_VALLEY_ELECTRICITY_TIMER, return_type=ValleyElectricityTimer
269
+ )
270
+ if result is not None:
271
+ self.valley_timer = result
272
+ return result
263
273
 
264
274
  @fallback_cache
265
275
  async def get_clean_summary(self) -> CleanSummary | None:
@@ -323,13 +333,11 @@ class RoborockClient:
323
333
  @fallback_cache
324
334
  async def get_prop(self) -> DeviceProp | None:
325
335
  """Gets device general properties."""
326
- [status, clean_summary, consumable, dnd_timer, valley_electricity_timer] = await asyncio.gather(
336
+ [status, clean_summary, consumable] = await asyncio.gather(
327
337
  *[
328
338
  self.get_status(),
329
339
  self.get_clean_summary(),
330
340
  self.get_consumable(),
331
- self.get_dnd_timer(),
332
- self.get_valley_electricity_timer(),
333
341
  ]
334
342
  )
335
343
  last_clean_record = None
@@ -338,13 +346,11 @@ class RoborockClient:
338
346
  dock_summary = None
339
347
  if status and status.dock_type is not None and status.dock_type != RoborockDockTypeCode.no_dock:
340
348
  dock_summary = await self.get_dock_summary(status.dock_type)
341
- if any([status, dnd_timer, clean_summary, consumable]):
349
+ if any([status, clean_summary, consumable]):
342
350
  return DeviceProp(
343
351
  status,
344
352
  clean_summary,
345
353
  consumable,
346
- dnd_timer,
347
- valley_electricity_timer,
348
354
  last_clean_record,
349
355
  dock_summary,
350
356
  )
@@ -223,6 +223,7 @@ class RoborockDockErrorCode(RoborockEnum):
223
223
  duct_blockage = 34
224
224
  water_empty = 38
225
225
  waste_water_tank_full = 39
226
+ dirty_tank_latch_open = 44
226
227
 
227
228
 
228
229
  class RoborockDockTypeCode(RoborockEnum):
@@ -8,12 +8,10 @@ from .containers import (
8
8
  CleanRecord,
9
9
  CleanSummary,
10
10
  Consumable,
11
- DnDTimer,
12
11
  DustCollectionMode,
13
12
  RoborockBase,
14
13
  SmartWashParams,
15
14
  Status,
16
- ValleyElectricityTimer,
17
15
  WashTowelMode,
18
16
  )
19
17
 
@@ -314,8 +312,6 @@ class DeviceProp(RoborockBase):
314
312
  status: Optional[Status] = None
315
313
  clean_summary: Optional[CleanSummary] = None
316
314
  consumable: Optional[Consumable] = None
317
- dnd_timer: Optional[DnDTimer] = None
318
- valley_electricity_timer: Optional[ValleyElectricityTimer] = None
319
315
  last_clean_record: Optional[CleanRecord] = None
320
316
  dock_summary: Optional[DockSummary] = None
321
317
 
@@ -326,10 +322,6 @@ class DeviceProp(RoborockBase):
326
322
  self.clean_summary = device_prop.clean_summary
327
323
  if device_prop.consumable:
328
324
  self.consumable = device_prop.consumable
329
- if device_prop.dnd_timer:
330
- self.dnd_timer = device_prop.dnd_timer
331
- if device_prop.valley_electricity_timer:
332
- self.valley_electricity_timer = device_prop.valley_electricity_timer
333
325
  if device_prop.last_clean_record:
334
326
  self.last_clean_record = device_prop.last_clean_record
335
327
  if device_prop.dock_summary:
@@ -1,79 +0,0 @@
1
- import asyncio
2
- import logging
3
-
4
- from roborock import (
5
- CacheableCommands,
6
- DeviceData,
7
- HomeDataDevice,
8
- ROBOROCK_S7_MAXV,
9
- )
10
- from roborock.local_api import RoborockLocalClient
11
-
12
- local_key = "nXTBj42ej5WxQopO"
13
-
14
- buffer = {0: bytes()}
15
-
16
-
17
- async def main():
18
- logging_config = {"level": logging.DEBUG}
19
- logging.basicConfig(**logging_config)
20
- device_info = DeviceData(
21
- device=HomeDataDevice(duid="1r9W0cAmDZ2COuVekgRhKA", local_key=local_key, name="test name", fv="1"),
22
- model=ROBOROCK_S7_MAXV,
23
- host="192.168.1.33",
24
- )
25
- print(CacheableCommands)
26
- client1 = RoborockLocalClient(device_info)
27
- # {
28
- # 'max_multi_map': 4,
29
- # 'max_bak_map': 1,
30
- # 'multi_map_count': 1,
31
- # 'map_info': [{
32
- # 'mapFlag': 0,
33
- # 'add_time': 1685652974,
34
- # 'length': 11,
35
- # 'name': 'Apartamento',
36
- # 'bak_maps': [{'mapFlag': 4, 'add_time': 1685552361}]
37
- # }]
38
- # }
39
- x = await client1.get_valley_electricity_timer()
40
- print(x)
41
- await asyncio.sleep(5)
42
-
43
- # capture = pyshark.LiveCapture(interface="rvi0")
44
- #
45
- # def on_package(packet: Packet):
46
- # if hasattr(packet, "ip"):
47
- # if packet.transport_layer == "TCP" and (packet.ip.dst == local_ip or packet.ip.src == local_ip):
48
- # if hasattr(packet, "DATA"):
49
- # if hasattr(packet.DATA, "data"):
50
- # if packet.ip.dst == local_ip:
51
- # print("Request")
52
- # try:
53
- # f, buffer[0] = MessageParser.parse(
54
- # buffer[0] + bytes.fromhex(packet.DATA.data), local_key
55
- # )
56
- # print(f)
57
- # except BaseException as e:
58
- # print(e)
59
- # pass
60
- # elif packet.ip.src == local_ip:
61
- # print("Response")
62
- # try:
63
- # f, buffer[0] = MessageParser.parse(
64
- # buffer[0] + bytes.fromhex(packet.DATA.data), local_key
65
- # )
66
- # print(f)
67
- # except BaseException as e:
68
- # print(e)
69
- # pass
70
- #
71
- # while True:
72
- # try:
73
- # await capture.packets_from_tshark(on_package, close_tshark=False)
74
- # except Exception as e:
75
- # print(e)
76
-
77
-
78
- if __name__ == "__main__":
79
- asyncio.run(main())