python-roborock 2.2.1__tar.gz → 2.2.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-2.2.1 → python_roborock-2.2.2}/PKG-INFO +1 -1
- {python_roborock-2.2.1 → python_roborock-2.2.2}/pyproject.toml +1 -1
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/version_1_apis/roborock_client_v1.py +19 -1
- {python_roborock-2.2.1 → python_roborock-2.2.2}/LICENSE +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/README.md +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/__init__.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/api.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/cli.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/cloud_api.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/code_mappings.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/command_cache.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/const.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/containers.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/exceptions.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/local_api.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/protocol.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/py.typed +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/roborock_future.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/roborock_message.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/roborock_typing.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/util.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/version_1_apis/__init__.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/version_1_apis/roborock_local_client_v1.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/version_1_apis/roborock_mqtt_client_v1.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/version_a01_apis/__init__.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/version_a01_apis/roborock_client_a01.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/version_a01_apis/roborock_mqtt_client_a01.py +0 -0
- {python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/web_api.py +0 -0
{python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/version_1_apis/roborock_client_v1.py
RENAMED
|
@@ -197,6 +197,24 @@ class RoborockClientV1(RoborockClient):
|
|
|
197
197
|
if isinstance(record, dict):
|
|
198
198
|
return CleanRecord.from_dict(record)
|
|
199
199
|
elif isinstance(record, list):
|
|
200
|
+
if isinstance(record[-1], dict):
|
|
201
|
+
records = [CleanRecord.from_dict(rec) for rec in record]
|
|
202
|
+
final_record = records[-1]
|
|
203
|
+
try:
|
|
204
|
+
# This code is semi-presumptions - so it is put in a try finally to be safe.
|
|
205
|
+
final_record.begin = records[0].begin
|
|
206
|
+
final_record.begin_datetime = records[0].begin_datetime
|
|
207
|
+
final_record.start_type = records[0].start_type
|
|
208
|
+
for rec in records[0:-1]:
|
|
209
|
+
final_record.duration += rec.duration if rec.duration is not None else 0
|
|
210
|
+
final_record.area += rec.area if rec.area is not None else 0
|
|
211
|
+
final_record.avoid_count += rec.avoid_count if rec.avoid_count is not None else 0
|
|
212
|
+
final_record.wash_count += rec.wash_count if rec.wash_count is not None else 0
|
|
213
|
+
final_record.square_meter_area += (
|
|
214
|
+
rec.square_meter_area if rec.square_meter_area is not None else 0
|
|
215
|
+
)
|
|
216
|
+
finally:
|
|
217
|
+
return final_record
|
|
200
218
|
# There are still a few unknown variables in this.
|
|
201
219
|
begin, end, duration, area = unpack_list(record, 4)
|
|
202
220
|
return CleanRecord(begin=begin, end=end, duration=duration, area=area)
|
|
@@ -277,7 +295,7 @@ class RoborockClientV1(RoborockClient):
|
|
|
277
295
|
"""Gets the mapping from segment id -> iot id. Only works on local api."""
|
|
278
296
|
mapping: list = await self.send_command(RoborockCommand.GET_ROOM_MAPPING)
|
|
279
297
|
if isinstance(mapping, list):
|
|
280
|
-
if not isinstance(mapping[0], list)
|
|
298
|
+
if len(mapping) == 2 and not isinstance(mapping[0], list):
|
|
281
299
|
return [RoomMapping(segment_id=mapping[0], iot_id=mapping[1])]
|
|
282
300
|
return [
|
|
283
301
|
RoomMapping(segment_id=segment_id, iot_id=iot_id) # type: ignore
|
|
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-2.2.1 → python_roborock-2.2.2}/roborock/version_1_apis/roborock_local_client_v1.py
RENAMED
|
File without changes
|
{python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/version_1_apis/roborock_mqtt_client_v1.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_roborock-2.2.1 → python_roborock-2.2.2}/roborock/version_a01_apis/roborock_client_a01.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|