Skip to content

Commit 56abc41

Browse files
committed
refactor: simplify device feature support checks by using DPS IDs instead of schema codes
1 parent 33ce0ef commit 56abc41

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

roborock/data/v1/v1_containers.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,14 @@ class FieldNameBase(StrEnum):
100100

101101

102102
class StatusField(FieldNameBase):
103-
"""An enum that represents a field in the `Status` class.
103+
"""An enum that represents a field in the `StatusV2` class.
104104
105105
This is used with `roborock.devices.traits.v1.status.DeviceFeaturesTrait`
106106
to understand if a feature is supported by the device using `is_field_supported`.
107107
108-
The enum values are names of fields in the `Status` class. Each field is annotated
109-
with a metadata value to determine if the field is supported by the device.
108+
The enum values are names of fields in the `StatusV2` class. Each field is
109+
annotated with `dps` metadata to map the field to a `RoborockDataProtocol`
110+
value used to check support against the product schema.
110111
"""
111112

112113
STATE = "state"
@@ -670,8 +671,9 @@ class ConsumableField(FieldNameBase):
670671
This is used with `roborock.devices.traits.v1.status.DeviceFeaturesTrait`
671672
to understand if a feature is supported by the device using `is_field_supported`.
672673
673-
The enum values are names of fields in the `Consumable` class. Each field is annotated
674-
with a metadata value to determine if the field is supported by the device.
674+
The enum values are names of fields in the `Consumable` class. Each field is
675+
annotated with `dps` metadata to map the field to a `RoborockDataProtocol`
676+
value used to check support against the product schema.
675677
"""
676678

677679
MAIN_BRUSH_WORK_TIME = "main_brush_work_time"

0 commit comments

Comments
 (0)