Skip to content

Commit c85232a

Browse files
authored
feat: add dust collection mode name for typing ease (#271)
1 parent 2356c16 commit c85232a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

roborock/roborock_typing.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,11 @@ class DeviceProp(RoborockBase):
461461
consumable: Consumable = field(default_factory=Consumable)
462462
last_clean_record: CleanRecord | None = None
463463
dock_summary: DockSummary | None = None
464+
dust_collection_mode_name: str | None = None
465+
466+
def __post_init__(self) -> None:
467+
if self.dock_summary and self.dock_summary.dust_collection_mode and self.dock_summary.dust_collection_mode.mode:
468+
self.dust_collection_mode_name = self.dock_summary.dust_collection_mode.mode.name
464469

465470
def update(self, device_prop: DeviceProp) -> None:
466471
if device_prop.status:
@@ -473,3 +478,4 @@ def update(self, device_prop: DeviceProp) -> None:
473478
self.last_clean_record = device_prop.last_clean_record
474479
if device_prop.dock_summary:
475480
self.dock_summary = device_prop.dock_summary
481+
self.__post_init__()

0 commit comments

Comments
 (0)