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
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).