From 487eb005508dbfa2de2d975fef0c78c55bb6e939 Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 8 Jan 2025 09:24:40 -0500 Subject: [PATCH] feat: add dust collection mode name for typing ease --- roborock/roborock_typing.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roborock/roborock_typing.py b/roborock/roborock_typing.py index 9ebf259..e7f7e02 100644 --- a/roborock/roborock_typing.py +++ b/roborock/roborock_typing.py @@ -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: @@ -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__()