Repository navigation
feat: add Q7 carpet settings and map names - #1040
ramon-angosto wants to merge 3 commits into
Conversation
Lash-L
left a comment
There was a problem hiding this comment.
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) targetsmainwhile stacked on top of #1038 (67ce5a18) and #1039 (6bbd0cc5); this review focuses specifically on commit63c929051d67efd83698a91558af23f3309998a8(feat: add Q7 carpet settings and map names). Rebasing ontomainonce #1038 and #1039 land (or retargeting the base branch in the interim) will isolate the diff. - Commit
63c92905is small and self-contained (~55 lines added across 6 files). Although carpet settings (set_carpet_turbo/set_carpet_avoid) and preservingQ7MapListEntry.nameare two independent Q7 additions, both are tiny additive updates and keeping them together in this commit is very easy to review.
- This PR (
- 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 = Noneaccurately models thenamefield returned alongsideidandcurinservice.get_map_listresponses.Q7PropertiesApi.set_carpet_turboandQ7PropertiesApi.set_carpet_avoidcleanly acceptenabled: booland send0/1viaprop.set(carpet_turbo/carpet_avoid).- One minor
B01Propscontainer consistency note inline onRoborockB01Props.CARPET_TURBO/CARPET_AVOID: addingcarpet_turbo: int | None = Noneandcarpet_avoid: int | None = NonetoB01Propspreserves the 1:1 field mapping withRoborockB01Propswhen those properties are queried directly viaquery_values([RoborockB01Props.CARPET_TURBO, RoborockB01Props.CARPET_AVOID]).
- Layer 2: Control Flow, Error Handling & Concurrency
- Async command dispatch in
set_carpet_turboandset_carpet_avoidis linear and side-effect-free.
- Async command dispatch in
- 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.parametrizeto cover bothset_carpet_turboandset_carpet_avoidacrossTrue/Falsestates, and verifyQ7MapListname deserialization.
- Unit tests cleanly use
| 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" |
There was a problem hiding this comment.
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().
There was a problem hiding this comment.
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.
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.
63c9290 to
318dc35
Compare
Lash-L
left a comment
There was a problem hiding this comment.
Automated code review by Gemini 4 Neon in Antigravity using our /review (/code-review) skill (.agents/skills/code-review/SKILL.md / AGENTS.md).
Scope & Stacking
- Stacked on #1038–#1039; this follow-up review covers PR #1040's own commit
318dc35(feat: add Q7 carpet settings and map names, 6 files, +65/-1), with cross-verification against the Roborock Q7 app bundle and Q7 (roborock.vacuum.sc05) firmware. - Prior review feedback addressed: Commit
318dc35resolves the Nov 15 review comment by addingcarpet_turbo: int | None = Noneandcarpet_avoid: int | None = NonetoB01Propsand addingtest_q7_api_query_carpet_settingsto cover directquery_values([CARPET_TURBO, CARPET_AVOID])calls.
Summary by Architectural Layer
- Priority 1 — Public Trait APIs & Consumer Contracts:
Q7MapListEntry.name: str | None = NoneandB01Props.carpet_turbo/carpet_avoidcleanly extend existingRoborockBasedataclasses with concrete types.Q7PropertiesApi.set_carpet_turbo(enabled: bool)andset_carpet_avoid(enabled: bool)match sibling boolean setters (set_child_lock,set_dust_auto_state,set_button_lights) with clean, consumer-agnostic signatures.
- Priority 2 — Data Lifecycle & State Management:
- Command dispatch in
set_carpet_turbo/set_carpet_avoidis linear and side-effect-free;MapTrait.refresh()preservesQ7MapListEntry.nameautomatically viaQ7MapList.from_dict().
- Command dispatch in
- Priority 3 — Wire Protocol & Firmware Verification:
- Carpet settings (
carpet_turbo/carpet_avoid): Verified against both the Roborock Q7 app bundle (carpetTurbo/carpetAvoidviaprop.setwith0/1, top-levelprop.getviagetCarpetTurbo/getCarpetTurboAndMultiFloor, and nestedprivacy.carpet_turbo/privacy.carpet_avoidin settings batches) and Q7sc05firmware (rriot_clientprop.set,prop.get, andprivacytables plusDeviceCleanConfiguint setters). - Map names (
service.get_map_list): Verified against the Q7 app bundle (map_list[]entries withid,cur,name) and Q7sc05firmware (rriot_clientmap_listkeysname,id,cur, and the built-in"Temporary map"default string).
- Carpet settings (
- Tests & Fixtures:
- Tests are properly colocated under mirror paths (
test_b01_q7_containers.py,test_init.py,test_map.py), reusefake_channelwith@pytest.mark.parametrize, and assert public behavior.
- Tests are properly colocated under mirror paths (
Verdict
No issues found after adversarial self-check. The PR is clean and ready to approve once #1038–#1039 land (and CI checks run on the branch).
Lash-L
left a comment
There was a problem hiding this comment.
Automated code review by Claude Opus 5.5 in Claude Code using our /review (/code-review) skill (.agents/skills/code-review/SKILL.md / AGENTS.md).
Follow-Up Review (318dc35)
Verdict: Does not pass /review. The code in this PR's own commit is fine, but the branch conflicts with main and has no CI run, so it has to be rebased first.
Scope and stack status
- The branch has three commits on top of
109f433(7.23.2):ad3991ffeat: add Q7 zone cleaning. This came from #1038, which was squash-merged ase9d8b34.19380d5feat: add Q7 remote control trait. This came from #1039, which was squash-merged as42976c0.318dc35feat: add Q7 carpet settings and map names. This is the only commit that belongs to #1040 (6 files, +65/-1).
- The two carried commits match what merged. Their added and removed lines are identical to
e9d8b34and42976c0, so no stale or diverged code is riding along. - The conflict comes only from the stale stack.
mainnow holds the squashed copies of #1038 and #1039, and later Q7 work has landed on top of them, including #1074 (dd74fa1, B01Fault aliases, touchingtest_b01_q7_containers.py). Runninggit merge-tree --write-tree origin/main 318dc35reports content conflicts in:roborock/devices/traits/b01/q7/__init__.pytests/data/b01_q7/test_b01_q7_containers.pytests/devices/traits/b01/q7/test_init.py
- Replaying only
318dc35onto currentmain(b46ae6f), with19380d5as the merge base, applies with no conflicts.
Earlier findings status
- 2026-11-15 review: add
carpet_turbo/carpet_avoidtoB01Propsso a directquery_values([CARPET_TURBO, CARPET_AVOID])keeps them. Resolved in318dc35(b01_q7_containers.py:209-210), andtest_q7_api_query_carpet_settingscovers it. - 2026-11-21 review: no issues, ready once #1038–#1039 land and CI runs. #1038 and #1039 have landed, but the branch was never rebased afterwards, so CI has still not run. That condition is still open and is the blocking item below.
Priority 1: Public Trait APIs & Consumer Contracts
-
[Blocking] Merge conflict with
main, and no CI. GitHub reports the PR asCONFLICTINGand there are no checks on318dc35. Rebase only this PR's commit onto currentmainand drop the two already-merged commits:git fetch origin git rebase --onto origin/main 19380d5 q7/3-carpet-map-names git push --force-with-lease
This leaves a single commit that applies cleanly. Then remove "Depends on #1039. Only the last commit belongs to this PR." from the description. #1041 (Q7 robot position) is stacked on this branch, so it will need the same
--ontorebase after this one moves. -
Q7PropertiesApi.set_carpet_turbo/set_carpet_avoid(roborock/devices/traits/b01/q7/__init__.py:227-233) takeenabled: booland sendint(enabled)throughset_prop. This matches the sibling settersset_child_lockandset_button_lights. The API is concrete, consumer-agnostic and has noAnyat the boundary. -
Q7MapListEntry.name: str | None = None(roborock/data/b01_q7/b01_q7_containers.py:120) is additive and optional, so map-list payloads without names still parse.
Priority 2: Data Lifecycle & State Management
- No issues. Both setters are one-shot writes with no cached state.
MapTrait.refresh()picks upnamethroughQ7MapList.from_dict()with no extra plumbing. - Nit (non-blocking): the two values now appear in two places,
B01Props.carpet_turbo(top level, filled only by a directprop.getof those keys) andB01Props.privacy.carpet_turbo(filled whenprivacyis queried). A one-line docstring on the newB01Propsfields (b01_q7_containers.py:209-210) would tell consumers which one is populated when.
Priority 3: Wire Protocols, Codecs & Enums
-
The wire names are correct. In the Q7 app bundle,
setCarpetTurbo,carpetTurboandcarpetAvoidsendprop.set {"carpet_turbo": v}/{"carpet_avoid": v}at the top level (unlikefloorDirection, which nests underprivacy).getCarpetTurbo/getCarpetTurboAndMultiFloorread them with a top-levelprop.get, and the settings screen readsprivacy.carpet_turbo/privacy.carpet_avoid.service.get_map_listentries carryid,curandname. This matches the earlier firmware cross-check of thesc05map_listkeys and the built-in"Temporary map"name. -
Nit (non-blocking): the comment at
roborock/roborock_message.py:332says the props are "reported nested underprivacyby prop.get". A directprop.getofcarpet_turbo/carpet_avoidreturns them at the top level, as this PR's own test and the live device both show. Only a query forprivacynests them. Suggested wording:# Settable individually via prop.set. A direct prop.get returns them top-level; # they are also reported nested under ``privacy``.
Tests & Fixtures
- The new tests are in the mirror paths:
tests/data/b01_q7/test_b01_q7_containers.py,tests/devices/traits/b01/q7/test_init.pyandtest_map.py. They usefake_channel, andtest_q7_api_set_carpet_settingsstacks two@pytest.mark.parametrizedecorators. The assertions check published commands and the parsed public models. No conformance allowlist changes.
Live test on a Q7 M5+
Device: Q7 M5+ (roborock.vacuum.sc05, protocol B01, firmware 03.01.80), real US cloud, at 318dc35.
query_values([CARPET_TURBO, CARPET_AVOID])returned{carpet_turbo: 1, carpet_avoid: 0}at the top level.set_carpet_turbo(False)followed byset_carpet_avoid(True)read back as{0, 1}. Restoring the original values read back as{1, 0}.map.refresh()returned the names:Map2(current),Map3,Map4,Temporary map(id 0) andDeans room.- Zone cleaning and remote control were not exercised because they move the robot. Both are already on
mainvia #1038 and #1039 and are not part of this PR's diff.
Local results
| Check | PR head 318dc35 |
318dc35 replayed onto main b46ae6f |
|---|---|---|
pytest tests |
2385 passed, 53 xfailed | 2867 passed, 46 xfailed, 168 snapshots passed |
ruff check / ruff format --check |
clean | clean |
mypy (Q7 trait + data modules) |
— | no issues |
| GitHub CI | no checks (branch conflicts) | — |
This is an automated review and can be incorrect, so please reply if any finding looks wrong.
Summary
Q7PropertiesApi.set_carpet_turbo(enabled)andset_carpet_avoid(enabled). They are written individually withprop.set {"carpet_turbo": 0|1}/{"carpet_avoid": 0|1}and read back nested underprivacy. The newRoborockB01Props.CARPET_TURBO/CARPET_AVOIDmembers are used.Q7MapListEntry.namekeeps the user-visible map name returned byservice.get_map_list(for example"Temporary map"for an unsaved map). The name was previously dropped.Testing
roborock.vacuum.sc05, firmware 03.01.80).