python-roborock 3.7.0__tar.gz → 3.7.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.
- {python_roborock-3.7.0 → python_roborock-3.7.2}/PKG-INFO +1 -1
- {python_roborock-3.7.0 → python_roborock-3.7.2}/pyproject.toml +1 -1
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/command.py +2 -1
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/home.py +42 -12
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/valley_electricity_timer.py +1 -1
- {python_roborock-3.7.0 → python_roborock-3.7.2}/.gitignore +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/LICENSE +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/README.md +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/api.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/broadcast_protocol.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/callbacks.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/cli.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/cloud_api.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/command_cache.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/const.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/b01_q10/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/b01_q10/b01_q10_code_mappings.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/b01_q10/b01_q10_containers.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/b01_q7/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/b01_q7/b01_q7_code_mappings.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/b01_q7/b01_q7_containers.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/code_mappings.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/containers.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/dyad/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/dyad/dyad_code_mappings.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/dyad/dyad_containers.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/v1/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/v1/v1_clean_modes.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/v1/v1_code_mappings.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/v1/v1_containers.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/zeo/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/zeo/zeo_code_mappings.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/data/zeo/zeo_containers.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/device_features.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/README.md +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/a01_channel.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/b01_channel.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/cache.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/channel.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/device.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/device_manager.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/local_channel.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/mqtt_channel.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/a01/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/b01/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/traits_mixin.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/child_lock.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/clean_summary.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/common.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/consumeable.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/device_features.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/do_not_disturb.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/dust_collection_mode.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/flow_led_status.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/led_status.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/map_content.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/maps.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/network_info.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/rooms.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/routines.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/smart_wash_params.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/status.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/volume.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/wash_towel_mode.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/v1_channel.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/v1_rpc_channel.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/exceptions.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/map/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/map/map_parser.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/mqtt/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/mqtt/roborock_session.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/mqtt/session.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/protocol.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/protocols/a01_protocol.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/protocols/b01_protocol.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/protocols/v1_protocol.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/py.typed +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/roborock_future.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/roborock_message.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/roborock_typing.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/util.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/version_1_apis/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/version_1_apis/roborock_client_v1.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/version_1_apis/roborock_local_client_v1.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/version_1_apis/roborock_mqtt_client_v1.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/version_a01_apis/__init__.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/version_a01_apis/roborock_client_a01.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/version_a01_apis/roborock_mqtt_client_a01.py +0 -0
- {python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/web_api.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-roborock
|
|
3
|
-
Version: 3.7.
|
|
3
|
+
Version: 3.7.2
|
|
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.7.
|
|
3
|
+
version = "3.7.2"
|
|
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"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import Any
|
|
2
2
|
|
|
3
3
|
from roborock import RoborockCommand
|
|
4
|
+
from roborock.protocols.v1_protocol import ParamsType
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
class CommandTrait:
|
|
@@ -14,7 +15,7 @@ class CommandTrait:
|
|
|
14
15
|
"""
|
|
15
16
|
self._rpc_channel = None
|
|
16
17
|
|
|
17
|
-
async def send(self, command: RoborockCommand | str, params:
|
|
18
|
+
async def send(self, command: RoborockCommand | str, params: ParamsType = None) -> Any:
|
|
18
19
|
"""Send a command to the device."""
|
|
19
20
|
if not self._rpc_channel:
|
|
20
21
|
raise ValueError("Device trait in invalid state")
|
|
@@ -7,6 +7,12 @@ on the map. It also makes it straight forward to fetch the map image and data.
|
|
|
7
7
|
This trait depends on the MapsTrait and RoomsTrait to gather the necessary
|
|
8
8
|
information. It provides properties to access the current map, the list of
|
|
9
9
|
rooms with names, and the map image and data.
|
|
10
|
+
|
|
11
|
+
Callers may first call `discover_home()` to populate the home layout cache by
|
|
12
|
+
iterating through all available maps on the device. This will cache the map
|
|
13
|
+
information and room names for all maps to minimize map switching and improve
|
|
14
|
+
performance. After the initial discovery, callers can call `refresh()` to update
|
|
15
|
+
the current map's information and room names as needed.
|
|
10
16
|
"""
|
|
11
17
|
|
|
12
18
|
import asyncio
|
|
@@ -64,6 +70,7 @@ class HomeTrait(RoborockBase, common.V1TraitMixin):
|
|
|
64
70
|
self._map_content = map_content
|
|
65
71
|
self._rooms_trait = rooms_trait
|
|
66
72
|
self._cache = cache
|
|
73
|
+
self._discovery_completed = False
|
|
67
74
|
self._home_map_info: dict[int, CombinedMapInfo] | None = None
|
|
68
75
|
self._home_map_content: dict[int, MapContent] | None = None
|
|
69
76
|
|
|
@@ -82,6 +89,7 @@ class HomeTrait(RoborockBase, common.V1TraitMixin):
|
|
|
82
89
|
if cache_data.home_map_info and cache_data.home_map_content:
|
|
83
90
|
_LOGGER.debug("Home cache already populated, skipping discovery")
|
|
84
91
|
self._home_map_info = cache_data.home_map_info
|
|
92
|
+
self._discovery_completed = True
|
|
85
93
|
try:
|
|
86
94
|
self._home_map_content = {
|
|
87
95
|
k: self._map_content.parse_map_content(v) for k, v in cache_data.home_map_content.items()
|
|
@@ -101,6 +109,7 @@ class HomeTrait(RoborockBase, common.V1TraitMixin):
|
|
|
101
109
|
|
|
102
110
|
home_map_info, home_map_content = await self._build_home_map_info()
|
|
103
111
|
_LOGGER.debug("Home discovery complete, caching data for %d maps", len(home_map_info))
|
|
112
|
+
self._discovery_completed = True
|
|
104
113
|
await self._update_home_cache(home_map_info, home_map_content)
|
|
105
114
|
|
|
106
115
|
async def _refresh_map_info(self, map_info) -> CombinedMapInfo:
|
|
@@ -156,8 +165,15 @@ class HomeTrait(RoborockBase, common.V1TraitMixin):
|
|
|
156
165
|
active maps or re-discover the home. It is expected that this will keep
|
|
157
166
|
information up to date for the current map as users switch to that map.
|
|
158
167
|
"""
|
|
159
|
-
if self.
|
|
160
|
-
|
|
168
|
+
if not self._discovery_completed:
|
|
169
|
+
# Running initial discovery also populates all of the same information
|
|
170
|
+
# as below so we can just call that method. If the device is busy
|
|
171
|
+
# then we'll fall through below to refresh the current map only.
|
|
172
|
+
try:
|
|
173
|
+
await self.discover_home()
|
|
174
|
+
return self
|
|
175
|
+
except RoborockDeviceBusy:
|
|
176
|
+
_LOGGER.debug("Cannot refresh home data while device is busy cleaning")
|
|
161
177
|
|
|
162
178
|
# Refresh the list of map names/info
|
|
163
179
|
await self._maps_trait.refresh()
|
|
@@ -170,7 +186,9 @@ class HomeTrait(RoborockBase, common.V1TraitMixin):
|
|
|
170
186
|
new_map_content = await self._refresh_map_content()
|
|
171
187
|
# Refresh the current map's room data
|
|
172
188
|
combined_map_info = await self._refresh_map_info(current_map_info)
|
|
173
|
-
await self.
|
|
189
|
+
await self._update_current_map(
|
|
190
|
+
map_flag, combined_map_info, new_map_content, update_cache=self._discovery_completed
|
|
191
|
+
)
|
|
174
192
|
return self
|
|
175
193
|
|
|
176
194
|
@property
|
|
@@ -206,16 +224,28 @@ class HomeTrait(RoborockBase, common.V1TraitMixin):
|
|
|
206
224
|
self._home_map_info = home_map_info
|
|
207
225
|
self._home_map_content = home_map_content
|
|
208
226
|
|
|
209
|
-
async def
|
|
210
|
-
self,
|
|
227
|
+
async def _update_current_map(
|
|
228
|
+
self,
|
|
229
|
+
map_flag: int,
|
|
230
|
+
map_info: CombinedMapInfo,
|
|
231
|
+
map_content: MapContent,
|
|
232
|
+
update_cache: bool,
|
|
211
233
|
) -> None:
|
|
212
234
|
"""Update the cache for the current map only."""
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
235
|
+
# Update the persistent cache if requested e.g. home discovery has
|
|
236
|
+
# completed and we want to keep it fresh. Otherwise just update the
|
|
237
|
+
# in memory map below.
|
|
238
|
+
if update_cache:
|
|
239
|
+
cache_data = await self._cache.get()
|
|
240
|
+
cache_data.home_map_info[map_flag] = map_info
|
|
241
|
+
if map_content.raw_api_response:
|
|
242
|
+
cache_data.home_map_content[map_flag] = map_content.raw_api_response
|
|
243
|
+
await self._cache.set(cache_data)
|
|
244
|
+
|
|
245
|
+
if self._home_map_info is None:
|
|
246
|
+
self._home_map_info = {}
|
|
220
247
|
self._home_map_info[map_flag] = map_info
|
|
248
|
+
|
|
249
|
+
if self._home_map_content is None:
|
|
250
|
+
self._home_map_content = {}
|
|
221
251
|
self._home_map_content[map_flag] = map_content
|
|
@@ -5,7 +5,7 @@ from roborock.roborock_typing import RoborockCommand
|
|
|
5
5
|
_ENABLED_PARAM = "enabled"
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
class ValleyElectricityTimerTrait(ValleyElectricityTimer, common.V1TraitMixin):
|
|
8
|
+
class ValleyElectricityTimerTrait(ValleyElectricityTimer, common.V1TraitMixin, common.RoborockSwitchBase):
|
|
9
9
|
"""Trait for managing Valley Electricity Timer settings on Roborock devices."""
|
|
10
10
|
|
|
11
11
|
command = RoborockCommand.GET_VALLEY_ELECTRICITY_TIMER
|
|
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.7.0 → python_roborock-3.7.2}/roborock/data/b01_q10/b01_q10_code_mappings.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_roborock-3.7.0 → python_roborock-3.7.2}/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.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/device_features.py
RENAMED
|
File without changes
|
{python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/do_not_disturb.py
RENAMED
|
File without changes
|
{python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/dust_collection_mode.py
RENAMED
|
File without changes
|
{python_roborock-3.7.0 → python_roborock-3.7.2}/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
|
{python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/devices/traits/v1/smart_wash_params.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_roborock-3.7.0 → python_roborock-3.7.2}/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
|
{python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/version_1_apis/roborock_client_v1.py
RENAMED
|
File without changes
|
{python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/version_1_apis/roborock_local_client_v1.py
RENAMED
|
File without changes
|
{python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/version_1_apis/roborock_mqtt_client_v1.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_roborock-3.7.0 → python_roborock-3.7.2}/roborock/version_a01_apis/roborock_client_a01.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|