Skip to content

fix(dyad): correct data point mappings and decode new data points - #1021

Merged
allenporter merged 1 commit into
Python-roborock:mainfrom
infy1995:feat/dyad-set-drying-mode
Nov 26, 2026
Merged

allenporter merged 1 commit into
Python-roborock:mainfrom
infy1995:feat/dyad-set-drying-mode

Conversation

@infy1995

@infy1995 infy1995 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

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): 3 is left and 4 is right. 5 to 8 are the diagonals. 5 and 6 were wrongly named left and right.
  • FLAT_STATUS (248) is now standing, flat or error instead of a bool, which reported the error state as lying flat.
  • DyadError has unknown. An unknown code used to fall back to none, so a real error looked like no error.

New values and data points

  • Errors 20010 (dirty_tank_or_filter_not_installed) and 20011 (squeegee_out_of_position), status 15 (combination) and self-clean water temperatures low and mid.
  • Data points 235 (feature bit mask), 251 (self-clean progress), 256 (DyadSprayMode), 273 (mechanical arm, bool), 274 (DyadTriggerMode), 275 (self-clean reminder, bool) and 276 (bit flags: 1 enough battery to self-clean, 2 enough to dry).
  • The ID of data point 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

  • Full pytest under WSL2 (Ubuntu) with dependency versions from uv.lock: 2977 passed, 45 xfailed on Python 3.11 and 3.14
  • pre-commit run --all-files: clean
  • The new decoding tests fail on the previous decoding (30 failures)

@infy1995
infy1995 marked this pull request as draft November 8, 2026 23:02
@infy1995 infy1995 changed the title feat(dyad): add F25 Ultra setting and self-clean commands feat(dyad): limit commands to what the app offers and fix data point mappings Nov 9, 2026
@infy1995
infy1995 marked this pull request as ready for review November 9, 2026 17:15
@Lash-L Lash-L added Feature New feature bug Something isn't working A01 A01 (Dyad / Zeo) platform labels Nov 15, 2026

@Lash-L Lash-L left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 raising RoborockUnsupportedFeature without transmitting unsupported payloads.
    • 1 finding: stop_drying() was already shipped in v7.19.0–v7.23.2 (from #1019); renaming it directly to stop() without a deprecated alias (or a BREAKING CHANGE / feat(dyad)!: marker) is a breaking change in a 7.x minor release (see inline comment).
    • 1 finding: dyad_feature.py is missing a370 (Marvis INT) from _MARVIS (see inline comment).
  • Priority 2 — Lifecycle, State & Concurrency:
    • DyadApi.supports() reads FEATURE_INFO directly from merged self._values, and start_self_clean() queries SELF_CLEAN_LEVEL via send_decoded_command (which blocks until the requested DP arrives or raises RoborockException on 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 DyadError from KNOWN_ENUMS_MISSING_UNKNOWN and adding unknown = -1 improves protocol resilience.
    • DyadFlatStatus, DyadPowerwheelDirection, DyadFeatureBits, DyadSelfCleanWaterTemp, and RoborockDyadStateCode.combination all include unknown = -1 fallbacks.
    • 1 finding: SELF_CLEAN_REMINDER (DP 275) is decoded as int(val) rather than bool(val) (see inline comment).
  • Tests & Fixtures (tests/devices/traits/a01/test_init.py, tests/devices/test_device_manager.py):
    • Strong parametrized test coverage in test_init.py using FakeChannel, and the test_start_connect_failure race fix in test_device_manager.py is clean.
    • Optional follow-up per AGENTS.md §5 (test mirroring): consider adding tests/devices/traits/a01/test_dyad_feature.py (mirroring test_device_feature.py) to directly cover all series/capability helpers including Marvis (a365–a370).

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 in MorphDurations (durationMin: 5 for turbo_dry_morph, durationMin: 22 for silent_dry_morph), shared by isMorphSeries || 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..9 including 3 = Left, 4 = Right, 5..8 diagonals), WaterTemperatureLevel (1..4), FeatureBit (0..10), and Error 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+223 and 239 when isSupportSmartSelfClean), startWith (200: 1 + 203), pause (200: 2), continue (200: 1), stop (200: 0), and clean_modes series rules all match.
  • Mismatches found:
    1. MODEL_MAP and publishConfig.products contain 79 models — a370 (Marvis, base, INT, app: true) is missing from _MARVIS in dyad_feature.py.
    2. DPType.SelfCleanReminder (DP 275) is strictly a DPBoolean (=== DPBoolean.True, matching MechanicalArm DP 273), 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"})

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
_MARVIS = frozenset({"a365", "a366", "a367", "a368", "a369"})
_MARVIS = frozenset({"a365", "a366", "a367", "a368", "a369", "a370"})

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread roborock/devices/traits/a01/__init__.py Outdated

async def stop_drying(self) -> None:
"""Stop a running drying cycle."""
async def stop(self) -> None:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread roborock/devices/traits/a01/__init__.py Outdated
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),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
RoborockDyadDataProtocol.SELF_CLEAN_REMINDER: lambda val: int(val),
RoborockDyadDataProtocol.SELF_CLEAN_REMINDER: lambda val: bool(val),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7c1ea84. DP 275 is now decoded with bool(val), like DP 273.

@Lash-L Lash-L added the /review run Code review skill (/review) has been run label Nov 21, 2026

@Lash-L Lash-L left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 a370 in _MARVIS (roborock/devices/traits/a01/dyad_feature.py): Resolved — a370 is now included in _MARVIS (all 79 models from com.roborock.wetdryvac v2674 accounted for), and the new mirrored test suite tests/devices/traits/a01/test_dyad_feature.py covers every series (including all six Marvis models a365–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 emitting DeprecationWarning (matching the existing StatusV2.dock_state convention) and delegating to stop(), with unit test coverage in test_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 with bool(val) and covered for both 0/False and 1/True in test_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.

@Lash-L Lash-L added the Passed /review Passed the /review skill check label Nov 21, 2026
@infy1995
infy1995 requested a review from Lash-L November 24, 2026 18:40
@infy1995
infy1995 marked this pull request as draft November 25, 2026 23:21
@infy1995
infy1995 force-pushed the feat/dyad-set-drying-mode branch from c388199 to cdf463c Compare November 25, 2026 23:33
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.
@infy1995 infy1995 changed the title feat(dyad): limit commands to what the app offers and fix data point mappings fix(dyad): correct data point mappings and decode new data points Nov 25, 2026
@github-actions github-actions Bot added the Data model changes Changes to data models, device info, or feature mappings label Nov 25, 2026
@infy1995
infy1995 marked this pull request as ready for review November 25, 2026 23:34
@infy1995

Copy link
Copy Markdown
Contributor Author

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:

  1. This PR: mapping fixes and new data points.
  2. Follow-ups: add the commands back grouped as traits, in several small PRs, keeping the released methods as deprecated aliases.
  3. Later: move A01 from query_values to async updates, where traits refresh their values and notify listeners when they arrive.

The earlier review comments about a370 and the stop_drying alias apply to the removed commands, so they will be handled in the follow-ups.

@allenporter
allenporter merged commit 23f4cef into Python-roborock:main Nov 26, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A01 A01 (Dyad / Zeo) platform bug Something isn't working Data model changes Changes to data models, device info, or feature mappings Feature New feature Passed /review Passed the /review skill check /review run Code review skill (/review) has been run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants