Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add dust collection mode name for typing ease #271

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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__()
Loading