3939from roborock .exceptions import RoborockException
4040from roborock .roborock_message import RoborockDataProtocol
4141
42- from ..containers import NamedRoomMapping , RoborockBase , RoborockBaseTimer , _attr_repr
42+ from ..containers import NamedRoomMapping , RoborockBase , RoborockBaseTimer , _attr_repr , field_metadata
4343from .v1_clean_modes import WashTowelModes
4444from .v1_code_mappings import (
4545 CleanFluidStatus ,
@@ -117,6 +117,15 @@ class StatusField(FieldNameBase):
117117 CHARGE_STATUS = "charge_status"
118118 DRY_STATUS = "dry_status"
119119 ERROR_CODE = "error_code"
120+ WATER_BOX_CARRIAGE_STATUS = "water_box_carriage_status"
121+ WATER_BOX_STATUS = "water_box_status"
122+ WATER_SHORTAGE_STATUS = "water_shortage_status"
123+ DIRTY_WATER_BOX_STATUS = "dirty_water_box_status"
124+ CLEAR_WATER_BOX_STATUS = "clear_water_box_status"
125+ CLEAN_FLUID_STATUS = "clean_fluid_status"
126+ CLEAN_PERCENT = "clean_percent"
127+ DOCK_ERROR_STATUS = "dock_error_status"
128+ RDT = "rdt"
120129
121130
122131@dataclass
@@ -246,12 +255,14 @@ def has_am(self) -> bool | None:
246255 return (self .dss & 3 ) == 2
247256
248257 @property
258+ @field_metadata (dock_feature = "is_washable" )
249259 def clear_water_box_status (self ) -> ClearWaterBoxStatus | None :
250260 if self .dss :
251261 return ClearWaterBoxStatus ((self .dss >> 2 ) & 3 )
252262 return None
253263
254264 @property
265+ @field_metadata (dock_feature = "is_washable" )
255266 def dirty_water_box_status (self ) -> DirtyWaterBoxStatus | None :
256267 if self .dss :
257268 return DirtyWaterBoxStatus ((self .dss >> 4 ) & 3 )
@@ -270,6 +281,9 @@ def water_box_filter_status(self) -> int | None:
270281 return None
271282
272283 @property
284+ @field_metadata (
285+ dock_feature = "is_clean_fluid_auto_delivery_supported" ,
286+ )
273287 def clean_fluid_status (self ) -> CleanFluidStatus | None :
274288 if self .dss :
275289 value = (self .dss >> 10 ) & 3
@@ -313,7 +327,7 @@ class StatusV2(RoborockBase):
313327 in_returning : int | None = None
314328 in_fresh_state : int | None = None
315329 lab_status : int | None = None
316- water_box_status : int | None = None
330+ water_box_status : int | None = field ( default = None , metadata = { "feature" : "is_support_water_mode" })
317331 back_type : int | None = None
318332 wash_phase : int | None = None
319333 wash_ready : int | None = None
@@ -323,14 +337,14 @@ class StatusV2(RoborockBase):
323337 is_locating : int | None = None
324338 lock_status : int | None = None
325339 water_box_mode : int | None = field (default = None , metadata = {"dps" : RoborockDataProtocol .WATER_BOX_MODE })
326- water_box_carriage_status : int | None = None
340+ water_box_carriage_status : int | None = field ( default = None , metadata = { "feature" : "is_support_water_mode" })
327341 mop_forbidden_enable : int | None = None
328342 camera_status : int | None = None
329343 is_exploring : int | None = None
330344 home_sec_status : int | None = None
331345 home_sec_enable_password : int | None = None
332346 adbumper_status : list [int ] | None = None
333- water_shortage_status : int | None = None
347+ water_shortage_status : int | None = field ( default = None , metadata = { "feature" : "is_support_water_mode" })
334348 dock_type : RoborockDockTypeCode | None = None
335349 dust_collection_status : int | None = None
336350 auto_dust_collection : int | None = None
@@ -339,7 +353,8 @@ class StatusV2(RoborockBase):
339353 debug_mode : int | None = None
340354 collision_avoid_status : int | None = None
341355 switch_map_mode : int | None = None
342- dock_error_status : RoborockDockErrorCode | None = None
356+ dock_error_status : RoborockDockErrorCode | None = field (default = None , metadata = {"dock_feature" : "has_dock" })
357+
343358 charge_status : RoborockChargeStatus | None = field (
344359 default = None , metadata = {"dps" : RoborockDataProtocol .CHARGE_STATUS }
345360 )
@@ -349,8 +364,8 @@ class StatusV2(RoborockBase):
349364 distance_off : int | None = None
350365 in_warmup : int | None = None
351366 dry_status : int | None = field (default = None , metadata = {"dps" : RoborockDataProtocol .DRYING_STATUS })
352- rdt : int | None = None
353- clean_percent : int | None = None
367+ rdt : int | None = field ( default = None , metadata = { "feature" : "is_supported_drying" })
368+ clean_percent : int | None = field ( default = None , metadata = { "feature" : "is_support_clean_estimate" })
354369 rss : int | None = None
355370 dss : int | None = None
356371 common_status : int | None = None
@@ -389,12 +404,14 @@ def has_am(self) -> bool | None:
389404 return (self .dss & 3 ) == 2
390405
391406 @property
407+ @field_metadata (dock_feature = "is_washable" )
392408 def clear_water_box_status (self ) -> ClearWaterBoxStatus | None :
393409 if self .dss :
394410 return ClearWaterBoxStatus ((self .dss >> 2 ) & 3 )
395411 return None
396412
397413 @property
414+ @field_metadata (dock_feature = "is_washable" )
398415 def dirty_water_box_status (self ) -> DirtyWaterBoxStatus | None :
399416 if self .dss :
400417 return DirtyWaterBoxStatus ((self .dss >> 4 ) & 3 )
@@ -413,6 +430,9 @@ def water_box_filter_status(self) -> int | None:
413430 return None
414431
415432 @property
433+ @field_metadata (
434+ dock_feature = "is_clean_fluid_auto_delivery_supported" ,
435+ )
416436 def clean_fluid_status (self ) -> CleanFluidStatus | None :
417437 if self .dss :
418438 value = (self .dss >> 10 ) & 3
0 commit comments