Repository navigation
Conversation
|
Tested against a real device: Roborock Q10 S5+ (ss07 firmware family), on commit Watched Observations:
This was a single-room spot clean, so I didn't get to observe a room-to-room transition in this pass. |
allenporter
left a comment
There was a problem hiding this comment.
Note: Conducting this code review following our /review skill using Antigravity (AGY) and Gemini 4 Argon.
Preserving custom room labels verbatim in Q10Room.name, redacting rawName in diagnostics, and calibrating trace coordinates from the header metadata look good.
We can simplify the current_room trait state and tests considerably:
-
Remove
_CURRENT_ROOM_STATESandself._current_room_trace_freshstate tracking inMapContentTrait:- Right now
MapContentTraitgatescurrent_roomon_CURRENT_ROOM_STATESand tracksself._current_room_trace_freshacross status and trace updates. - This makes
current_roominconsistent withrobot_position: when the robot isIDLEorRETURNING_HOME(or when map+trace packets arrive before the first status DPS),trait.robot_positionreturns the live position fromself._trace_packetwhiletrait.current_roomis forced toNone. - In V1 (
RoborockMapDataParser._get_current_vacuum_room), the current room (map_data.vacuum_room) is simply the room at the robot's position whenever the map and robot position are present—without gating on cleaning status. - Since
MapContentTraitalready clearsself._trace_packet = Nonewhenself._map_dps.robot_at_dockis true,current_roomcan be a stateless 3-line property derived directly from(self._map_packet, self._trace_packet). That also removes the need for the 7 mock-heavy status/arrival-order permutation tests intests/devices/traits/b01/q10/test_map.py.
- Right now
-
Remove defensive
math.isfinitechecks onintcoordinates andreplace(room)cloning:- See inline comments in
roborock/map/b01_q10_render.py.
- See inline comments in
-
Test through public entrypoints rather than private helpers or patched functions:
- See inline comments in
tests/devices/traits/b01/q10/test_map.pyandtests/map/test_b01_q10_render.py.
- See inline comments in
|
Hi! Marking as a draft until Allen's comments are addressed! |
33b5af5 to
3ee80aa
Compare
allenporter
left a comment
There was a problem hiding this comment.
Note: Conducting this code review following our /review skill using Antigravity (AGY) and Gemini 4 Argon.
Thanks for addressing all of the previous review comments—the stateless MapContentTrait.current_room property, simplified room lookup, and public-entrypoint tests look much cleaner!
A few items came up in re-review after the standalone rebuild onto main:
-
Restore custom room label preservation and
rawNamediagnostic redaction (dropped fromcd2621dduring the rebuild ontomain):Q10Room.name(roborock/map/b01_q10_map_parser.py): Without theif not self.raw_name.startswith("rr_"): return self.raw_nameguard, custom room labels exposed oncurrent_room.nameare modified by.replace("_", " ").strip().title()(e.g. turning"Salle d’eau"into"Salle D’Eau"or"Owner's bedroom"into"Owner'S Bedroom").REDACT_KEYS(roborock/diagnostics.py):MapContentTrait.as_dict()exports"currentRoom"(and"rooms") with"rawName", which needs"rawName"inREDACT_KEYS(andtest_redact_q10_raw_room_nameintests/test_diagnostics.py) so custom room names are redacted in diagnostics.
-
Avoid full-grid
packet.layersdecomposition on every synchronouscurrent_roomaccess:- See inline comment in
roborock/map/b01_q10_render.py.
- See inline comment in
-
Remove unused
solve_calibration_with_origin:- See inline comment in
roborock/map/b01_q10_render.py.
- See inline comment in
Expose
MapContentTrait.current_roomfrom the latest live robot pose and segmented map. Header metadata enables room resolution from the first pose; incomplete or unusable headers fall back to dense-path calibration. Outside-map and ambiguous nearby poses returnNone, and docking clears the live trace.Preserve custom room labels verbatim, redact
rawNamein diagnostics, and sample raw occupancy cells when validating header calibration. Remove the unused fixed-origin solver. Includes public resolver and trait regressions.Validation: 2,234 passed and 53 xfailed on Python 3.11 and 3.14; 11 broker tests deselected by repository configuration. Focused suites: 294 passed on each version. All pre-commit checks and wheel/source builds passed.
Updated on upstream
main(acd298ee, 7.19.0). GitHub CI passed, including MQTT-broker suites on Python 3.11 and 3.14. No physical-device validation was run for this revision. Related: #767.