Skip to content

feat: compose Q10 map content from grouped traits - #887

Merged
allenporter merged 6 commits into
Python-roborock:mainfrom
tubededentifrice:vc/q10-map-traits
Jul 21, 2026
Merged

feat: compose Q10 map content from grouped traits#887
allenporter merged 6 commits into
Python-roborock:mainfrom
tubededentifrice:vc/q10-map-traits

Conversation

@tubededentifrice

@tubededentifrice tubededentifrice commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Completes the Q10 map integration on top of #885 with a small low-level/high-level trait boundary matching the three incoming data streams.

  • MapDpsTrait owns restricted-zone and virtual-wall DPS values and exposes their decoded overlays.
  • MapContentTrait explicitly depends on that DPS trait, retains the latest map and trace packets, and calls the pure render_q10_map function whenever renderable source data changes.
  • The high-level trait exposes only caller-facing map data: the composed image, rooms, path, robot position, and heading.
  • Calibration, layers, projected map data, and other rendering intermediates stay inside the renderer.
  • A rendering failure clears the derived image instead of pairing stale image bytes with newer source state.
  • DPS updates received before any map are retained by MapDpsTrait without emitting a no-op high-level map notification.
  • Q10PropertiesApi wires the DPS trait into both DPS fanout and the dependent map-content trait.

The redundant path-specific CLI command from the staging stack is intentionally excluded, since normal image_content is already the single composed output. Trait tests cover source ownership and renderer handoff; calibration and pixel behavior remain in the map-module renderer tests.

Validation

  • pre-commit run --show-diff-on-failure --color=always --all-files
  • focused map/trait suite — 87 passed
  • pytest -q — 796 passed, 86 snapshots passed

Stack

Comment thread roborock/devices/traits/b01/q10/map.py
Comment thread roborock/devices/traits/b01/q10/map.py
Comment thread roborock/devices/traits/b01/q10/__init__.py Outdated
Comment thread roborock/devices/traits/b01/q10/map.py

@allenporter allenporter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just a minor change nit -- perhaps you can remove in a follow up PR? Thank you!

assert "q10-position" in cli.commands


def test_q10_map_dps_trait_is_private() -> None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets not test internal details like this, just exercise behavior through the "api" methods.

@allenporter
allenporter merged commit a66e7c3 into Python-roborock:main Jul 21, 2026
7 checks passed
@tubededentifrice
tubededentifrice deleted the vc/q10-map-traits branch July 21, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants