Skip to content

Commit b27092e

Browse files
Lash-LCopilot
andauthored
chore: some copilot suggestions
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent d4c0772 commit b27092e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

roborock/data/b01_q7/b01_q7_containers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class CleanRecordList(RoborockBase):
245245
class CleanRecordSummary(RoborockBase):
246246
"""Represents clean record totals for B01/Q7 devices."""
247247

248-
total_area: int | None = None
249248
total_time: int | None = None
249+
total_area: int | None = None
250250
total_count: int | None = None
251251
last_record_detail: CleanRecordDetail | None = None

roborock/devices/traits/b01/q7/clean_summary.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ class CleanSummaryTrait(CleanRecordSummary, Trait):
2525
"""B01/Q7 clean summary + clean record access (via record list service)."""
2626

2727
def __init__(self, channel: MqttChannel) -> None:
28+
"""Initialize the clean summary trait.
29+
30+
Args:
31+
channel: MQTT channel used to communicate with the device.
32+
"""
2833
super().__init__()
2934
self._channel = channel
3035

@@ -64,7 +69,7 @@ def _parse_record_detail(detail: dict | str | None) -> CleanRecordDetail | None:
6469
return CleanRecordDetail.from_dict(parsed)
6570
if isinstance(detail, dict):
6671
return CleanRecordDetail.from_dict(detail)
67-
raise TypeError(f"Unexpected B01 record detail type: {type(detail).__name__}: {detail!r}")
72+
raise RoborockException(f"Unexpected B01 record detail type: {type(detail).__name__}: {detail!r}")
6873

6974
async def get_clean_record_details(self, *, record_list: CleanRecordList | None = None) -> list[CleanRecordDetail]:
7075
"""Return parsed record detail objects (newest-first)."""
@@ -77,6 +82,6 @@ async def get_clean_record_details(self, *, record_list: CleanRecordList | None
7782
if parsed is not None:
7883
details.append(parsed)
7984

80-
# App treats the newest record as the end of the list
85+
# The app returns the newest record at the end of record_list; reverse so newest is first (index 0).
8186
details.reverse()
8287
return details

0 commit comments

Comments
 (0)