Skip to content

Commit c2e4b93

Browse files
committed
fix: address PR review comments from Lash-L
1 parent 5b27324 commit c2e4b93

4 files changed

Lines changed: 5 additions & 11 deletions

File tree

‎roborock/devices/traits/b01/q10/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def as_dict(self) -> dict[str, Any]:
166166
"""Return the trait data as a dictionary."""
167167
result: dict[str, Any] = {}
168168
for name, value in self.__dict__.items():
169-
if isinstance(value, RoborockBase):
169+
if isinstance(value, RoborockBase) and not name.startswith("_"):
170170
result[name] = value.as_dict()
171171
if hasattr(self, "map") and hasattr(self.map, "as_dict"):
172172
result["map"] = self.map.as_dict()

‎roborock/devices/traits/b01/q10/map.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
calibration, path placement and overlay placement remain inside the renderer.
1414
"""
1515

16+
import dataclasses
1617
import logging
1718
from dataclasses import dataclass, field
1819
from typing import Any
@@ -160,8 +161,6 @@ def _render(self) -> None:
160161

161162
def as_dict(self, exclude: set[str] | None = None) -> dict[str, Any]:
162163
"""Return the trait data as a dictionary, excluding large binary data."""
163-
import dataclasses
164-
165164
exclude_set = exclude or set()
166165
data = {
167166
"rooms": [dataclasses.asdict(room) for room in self.rooms],

‎roborock/diagnostics.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def reset(self) -> None:
104104
"name",
105105
"productId",
106106
"ipAddress",
107+
"ipAdress",
107108
"wifiName",
108109
"lat",
109110
"long",

‎tests/devices/traits/b01/q10/__snapshots__/test_status.ambr‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# serializer version: 1
22
# name: test_q10_properties_as_dict_and_diagnostic_data
33
dict({
4-
'_map_dps': dict({
5-
}),
64
'child_lock': dict({
75
'childLock': False,
86
}),
@@ -124,7 +122,7 @@
124122
}),
125123
'80': 0,
126124
'81': dict({
127-
'ipAdress': '192.168.1.52',
125+
'ipAdress': '**REDACTED**',
128126
'mac': '**REDACTED**',
129127
'signal': -42,
130128
'wifiName': '**REDACTED**',
@@ -381,8 +379,6 @@
381379
]),
382380
}),
383381
'traits': dict({
384-
'_map_dps': dict({
385-
}),
386382
'child_lock': dict({
387383
'childLock': False,
388384
}),
@@ -415,7 +411,7 @@
415411
}),
416412
'network_info': dict({
417413
'netInfo': dict({
418-
'ipAdress': '1.1.1.2',
414+
'ipAdress': '**REDACTED**',
419415
'mac': '**REDACTED**',
420416
'signal': -50,
421417
'wifiName': '**REDACTED**',
@@ -471,8 +467,6 @@
471467
# ---
472468
# name: test_q10_properties_as_dict_empty
473469
dict({
474-
'_map_dps': dict({
475-
}),
476470
'child_lock': dict({
477471
}),
478472
'consumable': dict({

0 commit comments

Comments
 (0)