-
Notifications
You must be signed in to change notification settings - Fork 57
chore: refactor to seperate b01 q7 and q10 logic #635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 refactors the B01 device support to separate Q7 and Q10 logic into distinct submodules, preparing for different messaging structures for these model variants.
Key Changes:
- Renamed
RoborockB01MethodstoRoborockB01Q7Methodsto reflect Q7-specific implementation - Moved B01 properties API from
b01/__init__.pytob01/q7/__init__.pyasQ7PropertiesApi - Added device model detection logic in device_manager.py to route Q7 devices (model contains 'sc') to the appropriate trait implementation
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| roborock/roborock_typing.py | Renamed enum class from RoborockB01Methods to RoborockB01Q7Methods for Q7-specific methods |
| roborock/protocols/b01_protocol.py | Updated import to use renamed RoborockB01Q7Methods |
| roborock/devices/traits/traits_mixin.py | Renamed property from b01_properties to b01_q7_properties |
| roborock/devices/traits/b01/q7/init.py | Created new Q7-specific implementation with Q7PropertiesApi class |
| roborock/devices/traits/b01/q10/init.py | Added placeholder file for future Q10 implementation |
| roborock/devices/traits/b01/init.py | Refactored to import from q7 submodule instead of implementing directly |
| roborock/devices/device_manager.py | Added conditional logic to route B01 devices to appropriate trait implementations based on model suffix |
Comments suppressed due to low confidence (1)
roborock/devices/traits/b01/init.py:5
- The name 'q&PropertiesApi' is exported by all but is not defined.
__all__ = ["q&PropertiesApi", "q7", "q10"]
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Allen Porter <allen.porter@gmail.com>
|
Waiting to merge this until after our current cycle Edit: will merge when approved |
| @@ -0,0 +1,31 @@ | |||
| """Traits for Q7 B01 devices. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| """Traits for Q7 B01 devices. | |
| """Traits for Q7 B01 devices. | |
Some clean up to make it easier to add selective support to the models as they use a different messaging strucutre