Repository navigation
feat: add Q7 zone cleaning - #1038
Open
ramon-angosto wants to merge 1 commit into
Open
ramon-angosto wants to merge 1 commit into
ramon-angosto wants to merge 1 commit into
Conversation
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.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds zone cleaning to the Q7 (B01) properties API:
Q7PropertiesApi.clean_zone(first_corner, second_corner)cleans one rectangle.Q7PropertiesApi.clean_zones([(first, second), ...])cleans several rectangles in a single task.Q7RoborockPoint(common Roborock millimetre coordinates, map origin at(25500, 25500)) withfrom_world()/to_world()conversions to the Q7 world coordinates (meters, origin next to the dock, y pointing up). This keeps the public API in the same coordinate space as other Roborock devices.Device protocol
The device needs three commands, in this order:
service.set_preference_type {"prefer_type": 4}selects zone cleaning.service.set_zone_points {"zone_points": [x1, y1, x2, y1, x2, y2, x1, y2, ...]}sends the corners of each rectangle in world meters. Multiple rectangles are concatenated.service.set_zone_clean {"ctrl_value": 1}starts the task.ctrl_value: 0stops it.While the zone task runs, the device reports
work_mode30 (PLAN_AREA).Testing
roborock.vacuum.sc05, firmware 03.01.80) with one and two zones.