Skip to content

Commit 32de01f

Browse files
committed
Truncate debug strings for MapContent
1 parent 0fc7200 commit 32de01f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

roborock/devices/traits/v1/map_content.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ class MapContent(RoborockBase):
2323
map_data: MapData | None = None
2424
"""The parsed map data which contains metadata for points on the map."""
2525

26+
def __repr__(self) -> str:
27+
"""Return a string representation of the MapContent."""
28+
img = self.image_content
29+
if self.image_content and len(self.image_content) > 20:
30+
img = f"{self.image_content[:17]}..."
31+
return f"MapContent(image_content={img!r}, map_data={self.map_data!r})"
2632

2733
@common.map_rpc_channel
2834
class MapContentTrait(MapContent, common.V1TraitMixin):

0 commit comments

Comments
 (0)