chore: add dataclasses for Roborock mower#862
Conversation
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds initial mower-specific data modeling support to the roborock.data layer, establishing a protocol enum and a RoborockBase-backed status dataclass with tests to validate serialization and DPS metadata mapping.
Changes:
- Introduces
RoborockMowerDataProtocolenum values for mower DPS and commands. - Adds
MowerStatusdataclass with DPS metadata for mower status updates. - Adds test coverage verifying
from_dict()behavior and DPS metadata mapping; re-exports mower models viaroborock.data.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/data/test_mower_containers.py | Adds unit tests for mower containers (from_dict + DPS metadata expectations). |
| roborock/roborock_message.py | Adds RoborockMowerDataProtocol enum for mower DPS/command identifiers. |
| roborock/data/mower/mower_containers.py | Introduces MowerStatus dataclass with DPS metadata fields. |
| roborock/data/mower/init.py | Exposes mower containers via package-level exports. |
| roborock/data/init.py | Re-exports mower module through roborock.data. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| error_code: int | None = field(default=None, metadata={"dps": RoborockMowerDataProtocol.ERROR_CODE}) | ||
| battery: int | None = field(default=None, metadata={"dps": RoborockMowerDataProtocol.BATTERY}) | ||
| mow_type: int | None = field(default=None, metadata={"dps": RoborockMowerDataProtocol.MOW_TYPE}) |
There was a problem hiding this comment.
i assume these will be enums in the future
There was a problem hiding this comment.
Yep! Didn't want to get too carried away in the first PR (trying to keep it semi-manageable especially as I am just going off RR_API code). The ones that make sense to be enums will be enums
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Accepted copilots suggestions - need a re-review |
Adds some dataclasses for some future work with mowers.