python-roborock 3.8.5__tar.gz → 3.9.0__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.
- {python_roborock-3.8.5 → python_roborock-3.9.0}/PKG-INFO +1 -1
- {python_roborock-3.8.5 → python_roborock-3.9.0}/pyproject.toml +1 -1
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/cache.py +2 -2
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/file_cache.py +15 -8
- {python_roborock-3.8.5 → python_roborock-3.9.0}/.gitignore +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/LICENSE +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/README.md +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/api.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/broadcast_protocol.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/callbacks.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/cli.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/cloud_api.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/command_cache.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/const.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/b01_q10/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/b01_q10/b01_q10_code_mappings.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/b01_q10/b01_q10_containers.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/b01_q7/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/b01_q7/b01_q7_code_mappings.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/b01_q7/b01_q7_containers.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/code_mappings.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/containers.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/dyad/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/dyad/dyad_code_mappings.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/dyad/dyad_containers.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/v1/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/v1/v1_clean_modes.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/v1/v1_code_mappings.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/v1/v1_containers.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/zeo/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/zeo/zeo_code_mappings.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/zeo/zeo_containers.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/device_features.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/README.md +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/a01_channel.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/b01_channel.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/channel.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/device.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/device_manager.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/local_channel.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/mqtt_channel.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/a01/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/b01/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/traits_mixin.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/child_lock.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/clean_summary.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/command.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/common.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/consumeable.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/device_features.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/do_not_disturb.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/dust_collection_mode.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/flow_led_status.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/home.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/led_status.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/map_content.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/maps.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/network_info.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/rooms.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/routines.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/smart_wash_params.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/status.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/valley_electricity_timer.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/volume.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/wash_towel_mode.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/v1_channel.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/exceptions.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/map/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/map/map_parser.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/mqtt/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/mqtt/health_manager.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/mqtt/roborock_session.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/mqtt/session.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/protocol.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/protocols/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/protocols/a01_protocol.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/protocols/b01_protocol.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/protocols/v1_protocol.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/py.typed +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/roborock_future.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/roborock_message.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/roborock_typing.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/util.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/version_1_apis/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/version_1_apis/roborock_client_v1.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/version_1_apis/roborock_local_client_v1.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/version_1_apis/roborock_mqtt_client_v1.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/version_a01_apis/__init__.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/version_a01_apis/roborock_client_a01.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/version_a01_apis/roborock_mqtt_client_a01.py +0 -0
- {python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/web_api.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-roborock
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.9.0
|
|
4
4
|
Summary: A package to control Roborock vacuums.
|
|
5
5
|
Project-URL: Repository, https://github.com/humbertogontijo/python-roborock
|
|
6
6
|
Project-URL: Documentation, https://python-roborock.readthedocs.io/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-roborock"
|
|
3
|
-
version = "3.
|
|
3
|
+
version = "3.9.0"
|
|
4
4
|
description = "A package to control Roborock vacuums."
|
|
5
5
|
authors = [{ name = "humbertogontijo", email = "humbertogontijo@users.noreply.github.com" }, {name="Lash-L"}, {name="allenporter"}]
|
|
6
6
|
requires-python = ">=3.11, <4"
|
|
@@ -8,12 +8,12 @@ this interface to provide their own caching mechanism.
|
|
|
8
8
|
from dataclasses import dataclass, field
|
|
9
9
|
from typing import Any, Protocol
|
|
10
10
|
|
|
11
|
-
from roborock.data import CombinedMapInfo, HomeData, NetworkInfo
|
|
11
|
+
from roborock.data import CombinedMapInfo, HomeData, NetworkInfo, RoborockBase
|
|
12
12
|
from roborock.device_features import DeviceFeatures
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
@dataclass
|
|
16
|
-
class CacheData:
|
|
16
|
+
class CacheData(RoborockBase):
|
|
17
17
|
"""Data structure for caching device information."""
|
|
18
18
|
|
|
19
19
|
home_data: HomeData | None = None
|
|
@@ -17,18 +17,25 @@ from .cache import Cache, CacheData
|
|
|
17
17
|
class FileCache(Cache):
|
|
18
18
|
"""File backed cache implementation."""
|
|
19
19
|
|
|
20
|
-
def __init__(
|
|
20
|
+
def __init__(
|
|
21
|
+
self,
|
|
22
|
+
file_path: pathlib.Path,
|
|
23
|
+
init_fn: Callable[[], CacheData] = CacheData,
|
|
24
|
+
serialize_fn: Callable[[Any], bytes] = pickle.dumps,
|
|
25
|
+
deserialize_fn: Callable[[bytes], Any] = pickle.loads,
|
|
26
|
+
) -> None:
|
|
21
27
|
"""Initialize the file cache with the given file path."""
|
|
22
28
|
self._init_fn = init_fn
|
|
23
29
|
self._file_path = file_path
|
|
24
30
|
self._cache_data: CacheData | None = None
|
|
31
|
+
self._serialize_fn = serialize_fn
|
|
32
|
+
self._deserialize_fn = deserialize_fn
|
|
25
33
|
|
|
26
34
|
async def get(self) -> CacheData:
|
|
27
35
|
"""Get cached value."""
|
|
28
36
|
if self._cache_data is not None:
|
|
29
37
|
return self._cache_data
|
|
30
|
-
|
|
31
|
-
data = await load_value(self._file_path)
|
|
38
|
+
data = await load_value(self._file_path, self._deserialize_fn)
|
|
32
39
|
if data is not None and not isinstance(data, CacheData):
|
|
33
40
|
raise TypeError(f"Invalid cache data loaded from {self._file_path}")
|
|
34
41
|
|
|
@@ -43,21 +50,21 @@ class FileCache(Cache):
|
|
|
43
50
|
"""Flush the cache to disk."""
|
|
44
51
|
if self._cache_data is None:
|
|
45
52
|
return
|
|
46
|
-
await store_value(self._file_path, self._cache_data)
|
|
53
|
+
await store_value(self._file_path, self._cache_data, self._serialize_fn)
|
|
47
54
|
|
|
48
55
|
|
|
49
|
-
async def store_value(file_path: pathlib.Path, value: Any) -> None:
|
|
56
|
+
async def store_value(file_path: pathlib.Path, value: Any, serialize_fn: Callable[[Any], bytes] = pickle.dumps) -> None:
|
|
50
57
|
"""Store a value to the given file path."""
|
|
51
58
|
|
|
52
59
|
def _store_to_disk(file_path: pathlib.Path, value: Any) -> None:
|
|
53
60
|
with open(file_path, "wb") as f:
|
|
54
|
-
data =
|
|
61
|
+
data = serialize_fn(value)
|
|
55
62
|
f.write(data)
|
|
56
63
|
|
|
57
64
|
await asyncio.to_thread(_store_to_disk, file_path, value)
|
|
58
65
|
|
|
59
66
|
|
|
60
|
-
async def load_value(file_path: pathlib.Path) -> Any | None:
|
|
67
|
+
async def load_value(file_path: pathlib.Path, deserialize_fn: Callable[[bytes], Any] = pickle.loads) -> Any | None:
|
|
61
68
|
"""Load a value from the given file path."""
|
|
62
69
|
|
|
63
70
|
def _load_from_disk(file_path: pathlib.Path) -> Any | None:
|
|
@@ -65,6 +72,6 @@ async def load_value(file_path: pathlib.Path) -> Any | None:
|
|
|
65
72
|
return None
|
|
66
73
|
with open(file_path, "rb") as f:
|
|
67
74
|
data = f.read()
|
|
68
|
-
return
|
|
75
|
+
return deserialize_fn(data)
|
|
69
76
|
|
|
70
77
|
return await asyncio.to_thread(_load_from_disk, file_path)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/b01_q10/b01_q10_code_mappings.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/data/b01_q7/b01_q7_code_mappings.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/device_features.py
RENAMED
|
File without changes
|
{python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/do_not_disturb.py
RENAMED
|
File without changes
|
{python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/dust_collection_mode.py
RENAMED
|
File without changes
|
{python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/flow_led_status.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/smart_wash_params.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/devices/traits/v1/wash_towel_mode.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/version_1_apis/roborock_client_v1.py
RENAMED
|
File without changes
|
{python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/version_1_apis/roborock_local_client_v1.py
RENAMED
|
File without changes
|
{python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/version_1_apis/roborock_mqtt_client_v1.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_roborock-3.8.5 → python_roborock-3.9.0}/roborock/version_a01_apis/roborock_client_a01.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|