Repository navigation
fix(dyad): correct data point mappings and decode new data points - #1021
Conversation
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).
Summary by Architectural Layer
- Priority 1 — Public Trait APIs & Consumer Contracts (
roborock/devices/traits/a01/__init__.py,roborock/devices/traits/a01/dyad_feature.py):- Clean typed command surface on
DyadApi(set_clean_mode,set_water_level,set_drying_mode,set_self_clean_intensity,set_suction,set_sponge_suction,start_self_clean,pause_self_clean,resume_self_clean,supports) properly gated by model capability checks and raisingRoborockUnsupportedFeaturewithout transmitting unsupported payloads. - 1 finding:
stop_drying()was already shipped inv7.19.0–v7.23.2(from #1019); renaming it directly tostop()without a deprecated alias (or aBREAKING CHANGE/feat(dyad)!:marker) is a breaking change in a7.xminor release (see inline comment). - 1 finding:
dyad_feature.pyis missinga370(Marvis INT) from_MARVIS(see inline comment).
- Clean typed command surface on
- Priority 2 — Lifecycle, State & Concurrency:
DyadApi.supports()readsFEATURE_INFOdirectly from mergedself._values, andstart_self_clean()queriesSELF_CLEAN_LEVELviasend_decoded_command(which blocks until the requested DP arrives or raisesRoborockExceptionon timeout). No lifecycle or concurrency issues found.
- Priority 3 — Wire Protocols, Codecs & Resilient Enums (
roborock/data/dyad/dyad_code_mappings.py,roborock/roborock_message.py,tests/conformance/test_enum_conformance.py):- Removing
DyadErrorfromKNOWN_ENUMS_MISSING_UNKNOWNand addingunknown = -1improves protocol resilience. DyadFlatStatus,DyadPowerwheelDirection,DyadFeatureBits,DyadSelfCleanWaterTemp, andRoborockDyadStateCode.combinationall includeunknown = -1fallbacks.- 1 finding:
SELF_CLEAN_REMINDER(DP 275) is decoded asint(val)rather thanbool(val)(see inline comment).
- Removing
- Tests & Fixtures (
tests/devices/traits/a01/test_init.py,tests/devices/test_device_manager.py):- Strong parametrized test coverage in
test_init.pyusingFakeChannel, and thetest_start_connect_failurerace fix intest_device_manager.pyis clean. - Optional follow-up per
AGENTS.md§5 (test mirroring): consider addingtests/devices/traits/a01/test_dyad_feature.py(mirroringtest_device_feature.py) to directly cover all series/capability helpers including Marvis (a365–a370).
- Strong parametrized test coverage in
Roborock App Plugin (com.roborock.wetdryvac v2674) Verification
Cross-checked all DPs, enum values, feature bits, command payloads, and the full 79-model capability table against the decompiled com.roborock.wetdryvac v2674 plugin:
- Confirmed:
- Drying modes (
5/22): Confirmed directly inMorphDurations(durationMin: 5forturbo_dry_morph,durationMin: 22forsilent_dry_morph), shared byisMorphSeries || isYaoGuangSeries. - Data points:
248(RemoteControlStatus),249(RemoteControlDirection),251(SelfCleanProgress),256(SprayMode),273(MechanicalArm),274(TriggerMode),275(SelfCleanReminder),276(BatteryThreshold),10008(History) all match. - Enums:
DPStatus(15 = Combination),DPRemoteControlStatus(0 = Standing,1 = Flat,2 = Error),DPRemoteControlDirection(0..9including3 = Left,4 = Right,5..8diagonals),WaterTemperatureLevel(1..4),FeatureBit(0..10), andError 20010(placeholder string###in plugin) all match. - Command payloads & pairings:
setAutoModeSuctionPower(206+208),setDehydrateIntensity(244+245) with(l2, l1),(l3, l2),(l4, l2),WaterLevel(l2..l4),setAutoSelfCleanMode(203+223and239whenisSupportSmartSelfClean),startWith(200: 1+203),pause(200: 2),continue(200: 1),stop(200: 0), andclean_modesseries rules all match.
- Drying modes (
- Mismatches found:
MODEL_MAPandpublishConfig.productscontain 79 models —a370(Marvis,base,INT,app: true) is missing from_MARVISindyad_feature.py.DPType.SelfCleanReminder(DP275) is strictly aDPBoolean(=== DPBoolean.True, matchingMechanicalArmDP273), not an integer.
| _SABER_BASE = frozenset({"a80", "a81"}) | ||
| _SABER_PLUS = frozenset({"a137", "a138"}) | ||
| _DAGGER = frozenset({"a109", "a110", "a111", "a112", "a113", "a132", "a145"}) # Flexi, Flexi Pro | ||
| _MARVIS = frozenset({"a365", "a366", "a367", "a368", "a369"}) |
There was a problem hiding this comment.
Priority 1 — Missing model a370 (Marvis INT)
In com.roborock.wetdryvac v2674 (MODEL_MAP and publishConfig.products), the Marvis series has 6 models (79 total across all series), including a370 (series: "Marvis", variant: "base", region: "INT", app: true, paired with CN a369). Omitting a370 causes roborock.wdv.a370 / roborock.wetdryvac.a370 to be treated as an unknown model and rejected with RoborockUnsupportedFeature.
| _MARVIS = frozenset({"a365", "a366", "a367", "a368", "a369"}) | |
| _MARVIS = frozenset({"a365", "a366", "a367", "a368", "a369", "a370"}) |
There was a problem hiding this comment.
Fixed in 7c1ea84. Our comparison script dropped the last row of the model table. a370 is now in _MARVIS, and tests/devices/traits/a01/test_dyad_feature.py covers every series including all six Marvis models.
|
|
||
| async def stop_drying(self) -> None: | ||
| """Stop a running drying cycle.""" | ||
| async def stop(self) -> None: |
There was a problem hiding this comment.
Priority 1 — Breaking rename of shipped public API stop_drying()
DyadApi.stop_drying() (from #1019) has been released since v7.19.0 (through v7.23.2). Removing it in a feat(dyad): (minor) PR breaks downstream callers in 7.x.
Consider keeping stop_drying as a thin deprecated alias delegating to stop() (or marking the PR/commit as a breaking change if removal is intentional):
async def stop_drying(self) -> None:
"""Stop a running drying cycle. Deprecated: use `stop()` instead."""
await self.stop()There was a problem hiding this comment.
Fixed in 7c1ea84. stop_drying() is back as a deprecated alias: it emits a DeprecationWarning and calls stop(), following the pattern of StatusV2.dock_state.
| RoborockDyadDataProtocol.SPRAY_MODE: lambda val: int(val), | ||
| RoborockDyadDataProtocol.MECHANICAL_ARM: lambda val: bool(val), | ||
| RoborockDyadDataProtocol.TRIGGER_MODE: lambda val: int(val), | ||
| RoborockDyadDataProtocol.SELF_CLEAN_REMINDER: lambda val: int(val), |
There was a problem hiding this comment.
Priority 3 — SELF_CLEAN_REMINDER (DP 275) is a boolean in the app plugin
In com.roborock.wetdryvac v2674, DP 275 is read exclusively as isSelfCleanReminder (get(DPType.SelfCleanReminder) === DPBoolean.True), identical to MECHANICAL_ARM (DP 273) two lines above. Decoding it as bool(val) now avoids a future breaking int -> bool type change.
| RoborockDyadDataProtocol.SELF_CLEAN_REMINDER: lambda val: int(val), | |
| RoborockDyadDataProtocol.SELF_CLEAN_REMINDER: lambda val: bool(val), |
There was a problem hiding this comment.
Fixed in 7c1ea84. DP 275 is now decoded with bool(val), like DP 273.
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).
Follow-up Review on 7c1ea84 (delta from 6b822df)
All three findings from the previous review have been cleanly resolved, with no new issues introduced:
- Priority 1 — Missing
a370in_MARVIS(roborock/devices/traits/a01/dyad_feature.py): Resolved —a370is now included in_MARVIS(all 79 models fromcom.roborock.wetdryvacv2674 accounted for), and the new mirrored test suitetests/devices/traits/a01/test_dyad_feature.pycovers every series (including all six Marvis modelsa365–a370) as well as unknown models. - Priority 1 — Breaking rename
stop_drying()→stop()(roborock/devices/traits/a01/__init__.py): Resolved —DyadApi.stop_drying()is retained as a thin deprecated alias emittingDeprecationWarning(matching the existingStatusV2.dock_stateconvention) and delegating tostop(), with unit test coverage intest_dyad_stop_drying_is_deprecated. - Priority 3 —
SELF_CLEAN_REMINDER(DP 275) decoding (roborock/devices/traits/a01/__init__.py): Resolved — DP 275 is now decoded withbool(val)and covered for both0/Falseand1/Trueintest_init.py.
All CI checks (lint, Lint Commit Messages, Python 3.11/3.14 test suites, Build Package, Test Semantic Release) pass on 7c1ea84. No remaining findings — this PR is clean and looks ready to merge.
c388199 to
cdf463c
Compare
Remote control directions 3 to 8 and the flat status were decoded wrongly, and an unknown error code read as no error. Also decode data points 235, 251, 256 and 273 to 276, errors 20010 and 20011, status 15 and the low and mid self-clean water temperatures.
|
As discussed on Discord, I trimmed this PR to the data point mapping fixes and decoding of missing data points. The commands that were here before are no longer part of it. Plan:
The earlier review comments about |
Summary
Fixes Dyad data points that the library decoded wrongly and decodes values that were missing. The data points and values were compared with the Roborock app plugin (
com.roborock.wetdryvac, plugin version 2674).This PR is now limited to decoding. The new commands that were here before, with their model checks, will follow in separate PRs, grouped as traits.
Mapping fixes
These change values reported by the library:
POWERWHEEL_DIRECTION(249):3is left and4is right.5to8are the diagonals.5and6were wrongly namedleftandright.FLAT_STATUS(248) is nowstanding,flatorerrorinstead of a bool, which reported the error state as lying flat.DyadErrorhasunknown. An unknown code used to fall back tonone, so a real error looked like no error.New values and data points
20010(dirty_tank_or_filter_not_installed) and20011(squeegee_out_of_position), status15(combination) and self-clean water temperatureslowandmid.235(feature bit mask),251(self-clean progress),256(DyadSprayMode),273(mechanical arm, bool),274(DyadTriggerMode),275(self-clean reminder, bool) and276(bit flags:1enough battery to self-clean,2enough to dry).10008(HISTORY), without a decoder.The names of statuses 4 and 14 do not match the plugin, but I kept them for compatibility and added comments.
Not verified
The mapping fixes and new values were not checked on a device. Driving the vacuum through data point 249 was deliberately not tested.
Conflicts with open PRs
None caused by this PR. It merges cleanly with #1080 and #1090, which change the same A01 module and test file.
Tests
pytestunder WSL2 (Ubuntu) with dependency versions fromuv.lock: 2977 passed, 45 xfailed on Python 3.11 and 3.14pre-commit run --all-files: clean