refactor: replace schema code strings with RoborockDataProtocol enums#808
Merged
allenporter merged 3 commits intoPython-roborock:mainfrom Apr 6, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors V1 trait field support detection to use DPS/schema IDs (via RoborockDataProtocol / RoborockEnum integer values) instead of string schema codes, in preparation for DPS-driven parsing/streaming updates.
Changes:
- Switch
DeviceFeaturesTrait.is_field_supported()fromrequires_schema_code/supported_schema_codestodps/supported_schema_ids. - Add
HomeDataProduct.supported_schema_idshelper derived fromHomeDataProductSchema.id. - Update V1 status/consumable container field metadata to store
RoborockDataProtocolenum members underdps.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
roborock/roborock_message.py |
Adjusts RoborockEnum import source for protocol enums. |
roborock/devices/traits/v1/device_features.py |
Uses dps metadata + supported_schema_ids for field support checks; adds dataclass field lookup helper. |
roborock/devices/traits/v1/__init__.py |
Updates trait-system documentation around field support metadata (needs follow-up corrections per comments). |
roborock/data/v1/v1_containers.py |
Replaces string schema-code metadata with dps enum metadata on V1 containers. |
roborock/data/containers.py |
Improves supported_schema_codes docstring and adds supported_schema_ids. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b25650b to
6ca34e0
Compare
…ues in status containers and add supported_schema_ids helper
…geProtocol and RoborockDataProtocol constants
6ca34e0 to
56a834d
Compare
Lash-L
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update the status containers and add supported_schema_ids helper to use the enum values instead of the string values. This renames the metadata field to "dps" to be prepared to support using this field for more than just if the feature is supported, but also for supporting parsing dynamic streaming updates of field values based on DPS key. This is pulled out of PR #799
This removes the check for dock_error_status since it is not a real DPS value.