Skip to content

Commit

Permalink
feat: add dust collection mode name for typing ease (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lash-L authored Jan 9, 2025
1 parent 2356c16 commit c85232a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions roborock/roborock_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,11 @@ class DeviceProp(RoborockBase):
consumable: Consumable = field(default_factory=Consumable)
last_clean_record: CleanRecord | None = None
dock_summary: DockSummary | None = None
dust_collection_mode_name: str | None = None

def __post_init__(self) -> None:
if self.dock_summary and self.dock_summary.dust_collection_mode and self.dock_summary.dust_collection_mode.mode:
self.dust_collection_mode_name = self.dock_summary.dust_collection_mode.mode.name

def update(self, device_prop: DeviceProp) -> None:
if device_prop.status:
Expand All @@ -473,3 +478,4 @@ def update(self, device_prop: DeviceProp) -> None:
self.last_clean_record = device_prop.last_clean_record
if device_prop.dock_summary:
self.dock_summary = device_prop.dock_summary
self.__post_init__()

0 comments on commit c85232a

Please sign in to comment.