Skip to content

Conversation

@Lash-L
Copy link
Collaborator

@Lash-L Lash-L commented Feb 1, 2026

Set from_code_optional to use Self instead of the class.

@codecov
Copy link

codecov bot commented Feb 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
roborock/data/code_mappings.py 91.53% <100.00%> (ø)
roborock/protocols/b01_q10_protocol.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 improves type safety by updating the from_code_optional method's return type annotation from RoborockModeEnum | None to Self | None, making it consistent with other methods in the RoborockModeEnum class. This change allows the removal of a type ignore comment that was previously needed.

Changes:

  • Updated from_code_optional return type to use Self for better type inference
  • Added a docstring to from_code_optional explaining its purpose
  • Removed the type ignore comment and outdated TODO comment in b01_q10_protocol.py

Reviewed changes

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

File Description
roborock/data/code_mappings.py Updated from_code_optional return type from RoborockModeEnum | None to Self | None and added docstring
roborock/protocols/b01_q10_protocol.py Removed type ignore comment and TODO comment that are no longer needed due to improved typing

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

@Lash-L Lash-L merged commit 220ae8b into main Feb 1, 2026
14 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