fix: use freeClean for T90 PRO OMNI room cleaning - #1710
digitalvir wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the twunby (DEEBOT T90 PRO OMNI) hardware profile to use the V2 room-cleaning command format and a V2-compatible room/map refresh path, avoiding unsupported map refresh commands that previously caused rcp not support failures.
Changes:
- Switch
twunbyroom cleaning toCleanV2+CleanAreaV2(producingclean_V2withcontent.type=freeCleanandcontent.value="1,5"for a one-pass room clean). - Add
CapabilityMapfortwunbythat refreshes rooms viaGetCachedMapInfoand supports position + map sets viaGetPosandGetMapSetV2, while disablingMajorMapEvent/MapTraceEventrefresh commands. - Add a hardware test asserting the above command/capability wiring for
twunby.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
deebot_client/hardware/twunby.py |
Switches twunby to V2 room cleaning and configures map capabilities to use cached map info + V2 map sets while avoiding unsupported major-map/trace refreshes. |
tests/hardware/test_init.py |
Adds a regression test verifying twunby uses V2 room-clean args and the intended map refresh command set. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Closing this for now. I want to keep validating the T90 support locally before proposing anything upstream. |
| return cls._get_handling_success_with_subset_command_args(data, subset_ids) | ||
|
|
||
| @staticmethod | ||
| def _is_named_room_subset(subset: list[str]) -> bool: |
There was a problem hiding this comment.
This check is not stable and we need a better way to detect the different schemas
|
Addressed the schema-detection review feedback in The previous revision made the named-room detection broader for all The only new schema detection now is for the observed T90 12-field room rows. That path requires exactly 12 fields and validates the parts present in the captured T90 payload shape: numeric id/icon/coordinate/flag fields, non-empty room name, and the expected Validation rerun locally:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (1)
deebot_client/commands/json/map/init.py:283
- The new room-subset gate still only treats exactly 10- or 11-field rows as “named-room” subsets, and only accepts 12-field rows if they match the T90-specific validator. This is stricter than the PR description (“at least 10 fields”) and may regress future models that append additional trailing fields (e.g., 13+) but keep the same leading schema (id/name/clean-config). Consider accepting any subset row with >=10 fields as named-room subsets (while still validating numeric id + non-empty name) to avoid incorrectly falling back to the legacy GetMapSubSet triggering path.
subset_len = len(subsets[0]) if subsets else 0
if subsets and (
subset_len in (10, 11)
or all(cls._is_t90_named_room_subset(subset) for subset in subsets)
):
bfc9a2e to
dcfc70e
Compare
|
Rebased this PR onto current The branch still keeps the schema-detection change intentionally conservative: existing 10-field and 11-field named-room formats keep their previous behavior, while the new detection only accepts the observed T90 12-field room rows with the fields we can validate from the captured payload. Validation rerun after rebase:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (3)
deebot_client/commands/json/map/init.py:327
- PR description says to accept named V2 room subset rows with at least 10 fields, but
_is_t90_named_room_subsetcurrently requires exactly 12 fields, so any 13+ field variant would be rejected even if the required fields are present. Allowing 12+ fields (and making_is_inttolerant of non-string values) keeps the parser forward-compatible while still validating the known required indices.
def _is_t90_named_room_subset(cls, subset: list[str]) -> bool:
if len(subset) != 12:
return False
if not str(subset[1]).strip():
deebot_client/commands/json/map/init.py:286
- The subset field index comments look 1-based, but the code uses 0-based indices (
subset[0]for id andsubset[1]for name). This mismatch makes the new format documentation harder to follow and increases the risk of future parsing bugs.
# subset values
# 1 -> id
# 2 -> name
deebot_client/commands/json/map/init.py:283
- The V2 named-room subset parsing gate accepts 10/11-field rows without validating the PR-stated requirements (numeric room id + non-empty room name), and it will also reject future 12+ field variants unless they match the T90-specific validator. Adding a lightweight per-row id/name validation here avoids
int(...)crashes and better matches the stated "at least 10 fields" contract.
This issue also appears on line 323 of the same file.
subset_len = len(subsets[0]) if subsets else 0
if subsets and (
subset_len in (10, 11)
or all(cls._is_t90_named_room_subset(subset) for subset in subsets)
):
The X9 PRO OMNI rejects the legacy clean/spotArea area command with '20003: rcp not support' (issue DeebotUniverse#1477). Start already used clean_V2, but area cleaning still used the legacy CleanArea command. Switch the area capability to the V2 freeClean command shape (CleanAreaV2 with CleanMode.FREE_CLEAN), same approach as the T90 PRO OMNI profile (PR DeebotUniverse#1710). Tested on a real X9 PRO OMNI: selected room cleaning starts correctly (mop wash cycle first, then cleans).
dcfc70e to
66cac8c
Compare
|
Rebased and deliberately narrowed this PR to the remaining T90 room-clean command fix. #1757 now owns the map capability and 12-field room-parser work, so this branch drops that overlap and keeps only the clean_V2/freeClean serialization required for T90 room cleaning. Validation on 66cac8c:
The original parser-focused changes-requested feedback is therefore superseded by upstream #1757. This PR is now ready for review solely as the freeClean room-cleaning fix. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1710 +/- ##
=======================================
Coverage 96.26% 96.26%
=======================================
Files 161 161
Lines 6399 6402 +3
Branches 368 368
=======================================
+ Hits 6160 6163 +3
Misses 172 172
Partials 67 67 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
not sure if this is the right place to answer, however, I already included this change into a custom integration and now everything seems to work. Many thanks for that terrific work! Except the multiselection of rooms for one clean process does not work. It will only process the first selected room. Not sure if this is already known. |
This PR now contains only the remaining T90 PRO OMNI room-clean command fix.
Map support and the 12-field T90 room parser were merged independently in #1757, so this branch has been rebased onto current dev and deliberately drops the overlapping map/capability work.
The remaining change makes T90 room cleaning serialize through clean_V2 with content.type = freeClean, which is the command shape verified against a real T90 PRO OMNI.
Validation: