Skip to content

Conversation

@lboue
Copy link
Contributor

@lboue lboue commented Feb 1, 2026

Summary

This PR fixes multiple typos found in the B01_Q10 device code mappings that were inherited from the original Roborock application source code. These corrections improve code clarity and consistency while maintaining compatibility with the device protocol.

Changes

Code Mapping Corrections:

  • FUN_LEVELFAN_LEVEL (constant name)
  • dpfunLeveldpFanLevel (property name)
  • dpRecendCleanRecorddpRecentCleanRecord (typo: "Recend" → "Recent")
  • dpCleanProgessdpCleanProgress (typo: "Progess" → "Progress")
  • REQUETDPSREQUEST_DPS (typo: "Requet" → "Request")
  • REQUSET_NOT_DISTURB_DATAREQUEST_NOT_DISTURB_DATA (typo: "Requset" → "Request")
  • YXFanLevel.SUPER value: 58 (corrected mode code)

Documentation:

  • Added inline comments documenting each typo to aid future reverse engineering efforts

Type Checking

  • Fixed mypy errors related to incorrect constant references
  • Updated test snapshots to reflect corrected property names

Testing

  • All tests pass with updated snapshots
  • All pre-commit hooks validated (mypy, commitlint, formatting)

@lboue lboue changed the title Rename FUN_LEVEL to FAN_LEVEL in code mappings Fix typos in code mappings for Roborock Feb 1, 2026
@allenporter
Copy link
Contributor

The requet DPS thing is similar -- it's following the naming of the internal code.

@lboue lboue marked this pull request as ready for review February 1, 2026 22:50
Copilot AI review requested due to automatic review settings February 1, 2026 22:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR corrects several typos in the Roborock B01/Q10 datapoint (DP) code mappings and updates tests/snapshots to match the corrected enum member names and DP value strings.

Changes:

  • Renames multiple B01_Q10_DP enum members and their .value strings to fix inherited typos (e.g., REQUETDPSREQUEST_DPS, FUN_LEVELFAN_LEVEL).
  • Updates protocol/e2e tests and snapshot outputs to reflect the corrected DP names.
  • Adjusts YXFanLevel.SUPER mode code from 5 to 8.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
roborock/data/b01_q10/b01_q10_code_mappings.py Fixes enum member/value typos and updates fan level mode code.
tests/protocols/test_b01_q10_protocol.py Updates protocol encoding test inputs to use renamed enum members.
tests/protocols/__snapshots__/test_b01_q10_protocol.ambr Updates snapshot keys and test case names to match corrected DP naming.
tests/e2e/test_device_manager.py Updates end-to-end command send to use renamed enum member.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

COMMON = ("dpCommon", 101)
JUMP_SCAN = ("dpJumpScan", 101)
REQUETDPS = ("dpRequetdps", 102) # NOTE: THIS TYPO IS FOUND IN SOURCE CODE
REQUEST_DPS = ("dpRequestDps", 102) # NOTE: typo "dpRequetdps" in source code
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

The test data file/snapshot identifier for this datapoint is still dpRequetdps (see tests/protocols/testdata/b01_q10_protocol/dpRequetdps.json and the snapshot section name), which is now inconsistent with the corrected enum value dpRequestDps. Renaming the fixture file and corresponding snapshot section would keep the tests aligned with the corrected mapping and avoid reintroducing the typo via test IDs.

Copilot uses AI. Check for mistakes.
STRONG = "strong", 3
MAX = "max", 4
SUPER = "super", 5
SUPER = "super", 8
Copy link
Collaborator

Choose a reason for hiding this comment

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

I was confused by this change, but it looks like the app stores the value as 5 then converts it to 8 when it sends it out.

@Lash-L Lash-L merged commit 601a402 into Python-roborock:main Feb 2, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants