@@ -121,6 +121,8 @@ def _requires_schema_code(requires_schema_code: str, default=None) -> Any:
121121
122122@dataclass
123123class Status (RoborockBase ):
124+ """This status will be deprecated in favor of StatusV2."""
125+
124126 msg_ver : int | None = None
125127 msg_seq : int | None = None
126128 state : RoborockStateCode | None = _requires_schema_code ("state" , default = None )
@@ -282,6 +284,140 @@ def __repr__(self) -> str:
282284 return _attr_repr (self )
283285
284286
287+ @dataclass
288+ class StatusV2 (RoborockBase ):
289+ """
290+ This is a new version of the Status object.
291+ This is the result of GET_STATUS from the api.
292+ """
293+
294+ msg_ver : int | None = None
295+ msg_seq : int | None = None
296+ state : RoborockStateCode | None = None
297+ battery : int | None = None
298+ clean_time : int | None = None
299+ clean_area : int | None = None
300+ error_code : RoborockErrorCode | None = None
301+ map_present : int | None = None
302+ in_cleaning : RoborockInCleaning | None = None
303+ in_returning : int | None = None
304+ in_fresh_state : int | None = None
305+ lab_status : int | None = None
306+ water_box_status : int | None = None
307+ back_type : int | None = None
308+ wash_phase : int | None = None
309+ wash_ready : int | None = None
310+ fan_power : int | None = None
311+ dnd_enabled : int | None = None
312+ map_status : int | None = None
313+ is_locating : int | None = None
314+ lock_status : int | None = None
315+ water_box_mode : int | None = None
316+ water_box_carriage_status : int | None = None
317+ mop_forbidden_enable : int | None = None
318+ camera_status : int | None = None
319+ is_exploring : int | None = None
320+ home_sec_status : int | None = None
321+ home_sec_enable_password : int | None = None
322+ adbumper_status : list [int ] | None = None
323+ water_shortage_status : int | None = None
324+ dock_type : RoborockDockTypeCode | None = None
325+ dust_collection_status : int | None = None
326+ auto_dust_collection : int | None = None
327+ avoid_count : int | None = None
328+ mop_mode : int | None = None
329+ debug_mode : int | None = None
330+ collision_avoid_status : int | None = None
331+ switch_map_mode : int | None = None
332+ dock_error_status : RoborockDockErrorCode | None = None
333+ charge_status : int | None = None
334+ unsave_map_reason : int | None = None
335+ unsave_map_flag : int | None = None
336+ wash_status : int | None = None
337+ distance_off : int | None = None
338+ in_warmup : int | None = None
339+ dry_status : int | None = None
340+ rdt : int | None = None
341+ clean_percent : int | None = None
342+ rss : int | None = None
343+ dss : int | None = None
344+ common_status : int | None = None
345+ corner_clean_mode : int | None = None
346+ last_clean_t : int | None = None
347+ replenish_mode : int | None = None
348+ repeat : int | None = None
349+ kct : int | None = None
350+ subdivision_sets : int | None = None
351+
352+ @property
353+ def square_meter_clean_area (self ) -> float | None :
354+ return round (self .clean_area / 1000000 , 1 ) if self .clean_area is not None else None
355+
356+ @property
357+ def error_code_name (self ) -> str | None :
358+ return self .error_code .name if self .error_code is not None else None
359+
360+ @property
361+ def state_name (self ) -> str | None :
362+ return self .state .name if self .state is not None else None
363+
364+ @property
365+ def current_map (self ) -> int | None :
366+ """Returns the current map ID if the map is present."""
367+ if self .map_status is not None :
368+ map_flag = self .map_status >> 2
369+ if map_flag != NO_MAP :
370+ return map_flag
371+ return None
372+
373+ @property
374+ def clear_water_box_status (self ) -> ClearWaterBoxStatus | None :
375+ if self .dss :
376+ return ClearWaterBoxStatus ((self .dss >> 2 ) & 3 )
377+ return None
378+
379+ @property
380+ def dirty_water_box_status (self ) -> DirtyWaterBoxStatus | None :
381+ if self .dss :
382+ return DirtyWaterBoxStatus ((self .dss >> 4 ) & 3 )
383+ return None
384+
385+ @property
386+ def dust_bag_status (self ) -> DustBagStatus | None :
387+ if self .dss :
388+ return DustBagStatus ((self .dss >> 6 ) & 3 )
389+ return None
390+
391+ @property
392+ def water_box_filter_status (self ) -> int | None :
393+ if self .dss :
394+ return (self .dss >> 8 ) & 3
395+ return None
396+
397+ @property
398+ def clean_fluid_status (self ) -> CleanFluidStatus | None :
399+ if self .dss :
400+ value = (self .dss >> 10 ) & 3
401+ if value == 0 :
402+ return None # Feature not supported by this device
403+ return None
404+
405+ @property
406+ def hatch_door_status (self ) -> int | None :
407+ if self .dss :
408+ return (self .dss >> 12 ) & 7
409+ return None
410+
411+ @property
412+ def dock_cool_fan_status (self ) -> int | None :
413+ if self .dss :
414+ return (self .dss >> 15 ) & 3
415+ return None
416+
417+ def __repr__ (self ) -> str :
418+ return _attr_repr (self )
419+
420+
285421@dataclass
286422class S4MaxStatus (Status ):
287423 fan_power : RoborockFanSpeedS6Pure | None = None
0 commit comments