Skip to content

Commit eef00e8

Browse files
committed
refactor: simplify device feature support checks by using DPS IDs instead of schema codes
1 parent 3d273e7 commit eef00e8

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
@@ -98,13 +98,14 @@ class FieldNameBase(StrEnum):
9898

9999

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

110111
STATE = "state"
@@ -629,8 +630,9 @@ class ConsumableField(FieldNameBase):
629630
This is used with `roborock.devices.traits.v1.status.DeviceFeaturesTrait`
630631
to understand if a feature is supported by the device using `is_field_supported`.
631632
632-
The enum values are names of fields in the `Consumable` class. Each field is annotated
633-
with a metadata value to determine if the field is supported by the device.
633+
The enum values are names of fields in the `Consumable` class. Each field is
634+
annotated with `dps` metadata to map the field to a `RoborockDataProtocol`
635+
value used to check support against the product schema.
634636
"""
635637

636638
MAIN_BRUSH_WORK_TIME = "main_brush_work_time"

0 commit comments

Comments
 (0)