Skip to content

feat: add Q7 carpet settings and map names - #1040

Open
ramon-angosto wants to merge 3 commits into
Python-roborock:mainfrom
ramon-angosto:q7/3-carpet-map-names
Open

ramon-angosto wants to merge 3 commits into
Python-roborock:mainfrom
ramon-angosto:q7/3-carpet-map-names

Conversation

@ramon-angosto

Copy link
Copy Markdown

Depends on #1039. Only the last commit belongs to this PR.

Summary

  • Q7PropertiesApi.set_carpet_turbo(enabled) and set_carpet_avoid(enabled). They are written individually with prop.set {"carpet_turbo": 0|1} / {"carpet_avoid": 0|1} and read back nested under privacy. The new RoborockB01Props.CARPET_TURBO / CARPET_AVOID members are used.
  • Q7MapListEntry.name keeps the user-visible map name returned by service.get_map_list (for example "Temporary map" for an unsaved map). The name was previously dropped.

Testing

  • Unit tests for both settings and for map list parsing with names.
  • Verified on a Q7 TF+ (roborock.vacuum.sc05, firmware 03.01.80).

@Lash-L Lash-L added Feature New feature Q7 B01 Q7 platform labels Nov 15, 2026

@Lash-L Lash-L left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Automated code review by Gemini 4 Argon in Antigravity using our /review (/code-review) skill (.agents/skills/code-review/SKILL.md / AGENTS.md).

Summary by Architectural Priority Layer

  • PR Scoping & Stack Note
    • This PR (q7/3-carpet-map-names) targets main while stacked on top of #1038 (67ce5a18) and #1039 (6bbd0cc5); this review focuses specifically on commit 63c929051d67efd83698a91558af23f3309998a8 (feat: add Q7 carpet settings and map names). Rebasing onto main once #1038 and #1039 land (or retargeting the base branch in the interim) will isolate the diff.
    • Commit 63c92905 is small and self-contained (~55 lines added across 6 files). Although carpet settings (set_carpet_turbo / set_carpet_avoid) and preserving Q7MapListEntry.name are two independent Q7 additions, both are tiny additive updates and keeping them together in this commit is very easy to review.
  • Layer 1: Core Abstractions, Data Models & Public APIs (roborock/data/b01_q7/b01_q7_containers.py, roborock/devices/traits/b01/q7/__init__.py, roborock/roborock_message.py)
    • Q7MapListEntry.name: str | None = None accurately models the name field returned alongside id and cur in service.get_map_list responses.
    • Q7PropertiesApi.set_carpet_turbo and Q7PropertiesApi.set_carpet_avoid cleanly accept enabled: bool and send 0/1 via prop.set (carpet_turbo / carpet_avoid).
    • One minor B01Props container consistency note inline on RoborockB01Props.CARPET_TURBO / CARPET_AVOID: adding carpet_turbo: int | None = None and carpet_avoid: int | None = None to B01Props preserves the 1:1 field mapping with RoborockB01Props when those properties are queried directly via query_values([RoborockB01Props.CARPET_TURBO, RoborockB01Props.CARPET_AVOID]).
  • Layer 2: Control Flow, Error Handling & Concurrency
    • Async command dispatch in set_carpet_turbo and set_carpet_avoid is linear and side-effect-free.
  • Layer 3: Code Hygiene, Typing & Tests (tests/data/b01_q7/test_b01_q7_containers.py, tests/devices/traits/b01/q7/test_init.py, tests/devices/traits/b01/q7/test_map.py)
    • Unit tests cleanly use @pytest.mark.parametrize to cover both set_carpet_turbo and set_carpet_avoid across True/False states, and verify Q7MapList name deserialization.

ADD_SWEEP_STATUS = "add_sweep_status"
# Settable individually via prop.set (reported nested under ``privacy`` by prop.get).
CARPET_TURBO = "carpet_turbo"
CARPET_AVOID = "carpet_avoid"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

RoborockB01Props is also the parameter enum for Q7PropertiesApi.query_values(props: list[RoborockB01Props]) -> B01Props | None. While prop.get nests carpet_turbo and carpet_avoid under privacy when RoborockB01Props.PRIVACY is queried, querying carpet_turbo or carpet_avoid directly in prop.get returns top-level carpet_turbo / carpet_avoid integer fields in the response payload.

Consider also adding carpet_turbo: int | None = None and carpet_avoid: int | None = None to B01Props in roborock/data/b01_q7/b01_q7_containers.py (matching all other RoborockB01Props members, such as quiet_is_open / quiet_begin_time / quiet_end_time) so query_values([RoborockB01Props.CARPET_TURBO, RoborockB01Props.CARPET_AVOID]) does not silently drop those fields during B01Props.from_dict().

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good catch, done in 318dc35: B01Props now has carpet_turbo and carpet_avoid, with a test that query_values([CARPET_TURBO, CARPET_AVOID]) keeps them.

@Lash-L Lash-L added the /review run Code review skill (/review) has been run label Nov 15, 2026
@Lash-L
Lash-L marked this pull request as draft November 15, 2026 19:57
Add `clean_zone` and `clean_zones` to the Q7 properties API. Zones are given
as two opposite corners in the common Roborock millimetre coordinate space
through a new `Q7RoborockPoint`, which converts to and from the Q7 world
coordinates (meters, origin next to the dock).

The device expects the zone preference type to be selected first
(`service.set_preference_type`), then the zone corners as a flat list
(`service.set_zone_points`), and finally `service.set_zone_clean` to start.
Several zones are concatenated into a single task.
Add a `RemoteTrait` to the Q7 properties API, mirroring the Q10 remote API.
Manual mode is entered with `prop.set sweep_type=5` and the robot is driven
with `service.set_direction` (1 forward, 2 left, 3 right, 0 exit). Each
command moves the robot for a short burst, so callers repeat it while a
direction is held. Leaving remote mode restores `sweep_type=0`.
Add `set_carpet_turbo` and `set_carpet_avoid` to the Q7 properties API. Both
are written individually with `prop.set` (`carpet_turbo` / `carpet_avoid`)
and reported back nested under `privacy`.

Keep the user-visible `name` of each entry returned by
`service.get_map_list`, which was previously dropped.
@ramon-angosto
ramon-angosto marked this pull request as ready for review November 16, 2026 08:07

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature Q7 B01 Q7 platform /review run Code review skill (/review) has been run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants