feat: improvements to B01 for HA integration#686
Conversation
Codecov Report❌ Patch coverage is
... and 13 files with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR improves the B01 integration for Home Assistant by fixing enum value access. Previously, the code used .name which returns the enum member name (e.g., "CHARGING"), but now correctly uses .value which returns the actual string value (e.g., "charging"). This change affects the RoborockModeEnum class and its usage in B01 Q7 model properties.
- Changed
RoborockModeEnum.keys()to return enum values instead of names - Updated four property accessors in
B01Propsto use.valueinstead of.name
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| roborock/data/code_mappings.py | Modified RoborockModeEnum.keys() method to return member.value instead of member.name, making it consistent with returning the string values stored in the enum |
| roborock/data/b01_q7/b01_q7_containers.py | Updated four property methods (status_name, fault_name, wind_name, work_mode_name) to return enum.value instead of enum.name, ensuring they return the descriptive string values like "charging" instead of uppercase names like "CHARGING" |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
PR for basic Q7 support is ready outside of this and a version bump. Once this is in i will try to do basic support for Q10 |
.name gets the enum name i.e. CHARGING instead of it's value: "charging"