roborock.data.v1.v1_containers
1import datetime 2import logging 3from dataclasses import dataclass, field 4from enum import StrEnum 5from typing import Any 6 7from roborock.const import ( 8 CLEANING_BRUSH_REPLACE_TIME, 9 DUST_COLLECTION_REPLACE_TIME, 10 FILTER_REPLACE_TIME, 11 MAIN_BRUSH_REPLACE_TIME, 12 MOP_ROLLER_REPLACE_TIME, 13 NO_MAP, 14 ROBOROCK_G10S_PRO, 15 ROBOROCK_P10, 16 ROBOROCK_Q7_MAX, 17 ROBOROCK_QREVO_CURV, 18 ROBOROCK_QREVO_MASTER, 19 ROBOROCK_QREVO_MAXV, 20 ROBOROCK_QREVO_PRO, 21 ROBOROCK_QREVO_S, 22 ROBOROCK_S4_MAX, 23 ROBOROCK_S5_MAX, 24 ROBOROCK_S6, 25 ROBOROCK_S6_MAXV, 26 ROBOROCK_S6_PURE, 27 ROBOROCK_S7, 28 ROBOROCK_S7_MAXV, 29 ROBOROCK_S8, 30 ROBOROCK_S8_MAXV_ULTRA, 31 ROBOROCK_S8_PRO_ULTRA, 32 ROBOROCK_SAROS_10, 33 ROBOROCK_SAROS_10R, 34 SENSOR_DIRTY_REPLACE_TIME, 35 SIDE_BRUSH_REPLACE_TIME, 36 STRAINER_REPLACE_TIME, 37 ROBOROCK_G20S_Ultra, 38) 39from roborock.exceptions import RoborockException 40from roborock.roborock_message import RoborockDataProtocol 41 42from ..containers import NamedRoomMapping, RoborockBase, RoborockBaseTimer, _attr_repr 43from .v1_clean_modes import WashTowelModes 44from .v1_code_mappings import ( 45 CleanFluidStatus, 46 ClearWaterBoxStatus, 47 DirtyWaterBoxStatus, 48 DustBagStatus, 49 RoborockChargeStatus, 50 RoborockCleanType, 51 RoborockDockDustCollectionModeCode, 52 RoborockDockErrorCode, 53 RoborockDockState, 54 RoborockDockTypeCode, 55 RoborockErrorCode, 56 RoborockFanPowerCode, 57 RoborockFanSpeedP10, 58 RoborockFanSpeedQ7Max, 59 RoborockFanSpeedQRevoCurv, 60 RoborockFanSpeedQRevoMaster, 61 RoborockFanSpeedQRevoMaxV, 62 RoborockFanSpeedS6Pure, 63 RoborockFanSpeedS7, 64 RoborockFanSpeedS7MaxV, 65 RoborockFanSpeedS8MaxVUltra, 66 RoborockFanSpeedSaros10, 67 RoborockFanSpeedSaros10R, 68 RoborockFinishReason, 69 RoborockInCleaning, 70 RoborockMopIntensityCode, 71 RoborockMopIntensityP10, 72 RoborockMopIntensityQ7Max, 73 RoborockMopIntensityQRevoCurv, 74 RoborockMopIntensityQRevoMaster, 75 RoborockMopIntensityQRevoMaxV, 76 RoborockMopIntensityS5Max, 77 RoborockMopIntensityS6MaxV, 78 RoborockMopIntensityS7, 79 RoborockMopIntensityS8MaxVUltra, 80 RoborockMopIntensitySaros10, 81 RoborockMopIntensitySaros10R, 82 RoborockMopModeCode, 83 RoborockMopModeQRevoCurv, 84 RoborockMopModeQRevoMaster, 85 RoborockMopModeQRevoMaxV, 86 RoborockMopModeS7, 87 RoborockMopModeS8MaxVUltra, 88 RoborockMopModeS8ProUltra, 89 RoborockMopModeSaros10, 90 RoborockMopModeSaros10R, 91 RoborockStartType, 92 RoborockStateCode, 93) 94 95_LOGGER = logging.getLogger(__name__) 96 97 98class FieldNameBase(StrEnum): 99 """A base enum class that represents a field name in a RoborockBase dataclass.""" 100 101 102class StatusField(FieldNameBase): 103 """An enum that represents a field in the `StatusV2` class. 104 105 This is used with `roborock.devices.traits.v1.status.DeviceFeaturesTrait` 106 to understand if a feature is supported by the device using `is_field_supported`. 107 108 The enum values are names of fields in the `StatusV2` class. Each field is 109 annotated with `dps` metadata to map the field to a `RoborockDataProtocol` 110 value used to check support against the product schema. 111 """ 112 113 STATE = "state" 114 BATTERY = "battery" 115 FAN_POWER = "fan_power" 116 WATER_BOX_MODE = "water_box_mode" 117 CHARGE_STATUS = "charge_status" 118 DRY_STATUS = "dry_status" 119 ERROR_CODE = "error_code" 120 121 122@dataclass 123class Status(RoborockBase): 124 """This status will be deprecated in favor of StatusV2.""" 125 126 msg_ver: int | None = None 127 msg_seq: int | None = None 128 state: RoborockStateCode | None = field(default=None, metadata={"dps": RoborockDataProtocol.STATE}) 129 battery: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.BATTERY}) 130 clean_time: int | None = None 131 clean_area: int | None = None 132 error_code: RoborockErrorCode | None = field(default=None, metadata={"dps": RoborockDataProtocol.ERROR_CODE}) 133 map_present: int | None = None 134 in_cleaning: RoborockInCleaning | None = None 135 in_returning: int | None = None 136 in_fresh_state: int | None = None 137 lab_status: int | None = None 138 water_box_status: int | None = None 139 back_type: int | None = None 140 wash_phase: int | None = None 141 wash_ready: int | None = None 142 fan_power: RoborockFanPowerCode | None = field(default=None, metadata={"dps": RoborockDataProtocol.FAN_POWER}) 143 dnd_enabled: int | None = None 144 map_status: int | None = None 145 is_locating: int | None = None 146 lock_status: int | None = None 147 water_box_mode: RoborockMopIntensityCode | None = field( 148 default=None, metadata={"dps": RoborockDataProtocol.WATER_BOX_MODE} 149 ) 150 water_box_carriage_status: int | None = None 151 mop_forbidden_enable: int | None = None 152 camera_status: int | None = None 153 is_exploring: int | None = None 154 home_sec_status: int | None = None 155 home_sec_enable_password: int | None = None 156 adbumper_status: list[int] | None = None 157 water_shortage_status: int | None = None 158 dock_type: RoborockDockTypeCode | None = None 159 dust_collection_status: int | None = None 160 auto_dust_collection: int | None = None 161 avoid_count: int | None = None 162 mop_mode: RoborockMopModeCode | None = None 163 debug_mode: int | None = None 164 collision_avoid_status: int | None = None 165 switch_map_mode: int | None = None 166 dock_error_status: RoborockDockErrorCode | None = None 167 charge_status: RoborockChargeStatus | None = field( 168 default=None, metadata={"dps": RoborockDataProtocol.CHARGE_STATUS} 169 ) 170 unsave_map_reason: int | None = None 171 unsave_map_flag: int | None = None 172 wash_status: int | None = None 173 distance_off: int | None = None 174 in_warmup: int | None = None 175 dry_status: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.DRYING_STATUS}) 176 rdt: int | None = None 177 clean_percent: int | None = None 178 rss: int | None = None 179 dss: int | None = None 180 common_status: int | None = None 181 corner_clean_mode: int | None = None 182 last_clean_t: int | None = None 183 replenish_mode: int | None = None 184 repeat: int | None = None 185 kct: int | None = None 186 subdivision_sets: int | None = None 187 188 @property 189 def square_meter_clean_area(self) -> float | None: 190 return round(self.clean_area / 1000000, 1) if self.clean_area is not None else None 191 192 @property 193 def error_code_name(self) -> str | None: 194 return self.error_code.name if self.error_code is not None else None 195 196 @property 197 def state_name(self) -> str | None: 198 return self.state.name if self.state is not None else None 199 200 @property 201 def water_box_mode_name(self) -> str | None: 202 return self.water_box_mode.name if self.water_box_mode is not None else None 203 204 @property 205 def fan_power_options(self) -> list[str]: 206 if self.fan_power is None: 207 return [] 208 return list(self.fan_power.keys()) 209 210 @property 211 def fan_power_name(self) -> str | None: 212 return self.fan_power.name if self.fan_power is not None else None 213 214 @property 215 def mop_mode_name(self) -> str | None: 216 return self.mop_mode.name if self.mop_mode is not None else None 217 218 def get_fan_speed_code(self, fan_speed: str) -> int: 219 if self.fan_power is None: 220 raise RoborockException("Attempted to get fan speed before status has been updated.") 221 return self.fan_power.as_dict().get(fan_speed) 222 223 def get_mop_intensity_code(self, mop_intensity: str) -> int: 224 if self.water_box_mode is None: 225 raise RoborockException("Attempted to get mop_intensity before status has been updated.") 226 return self.water_box_mode.as_dict().get(mop_intensity) 227 228 def get_mop_mode_code(self, mop_mode: str) -> int: 229 if self.mop_mode is None: 230 raise RoborockException("Attempted to get mop_mode before status has been updated.") 231 return self.mop_mode.as_dict().get(mop_mode) 232 233 @property 234 def current_map(self) -> int | None: 235 """Returns the current map ID if the map is present.""" 236 if self.map_status is not None: 237 map_flag = self.map_status >> 2 238 if map_flag != NO_MAP: 239 return map_flag 240 return None 241 242 @property 243 def clear_water_box_status(self) -> ClearWaterBoxStatus | None: 244 if self.dss: 245 return ClearWaterBoxStatus((self.dss >> 2) & 3) 246 return None 247 248 @property 249 def dirty_water_box_status(self) -> DirtyWaterBoxStatus | None: 250 if self.dss: 251 return DirtyWaterBoxStatus((self.dss >> 4) & 3) 252 return None 253 254 @property 255 def dust_bag_status(self) -> DustBagStatus | None: 256 if self.dss: 257 return DustBagStatus((self.dss >> 6) & 3) 258 return None 259 260 @property 261 def water_box_filter_status(self) -> int | None: 262 if self.dss: 263 return (self.dss >> 8) & 3 264 return None 265 266 @property 267 def clean_fluid_status(self) -> CleanFluidStatus | None: 268 if self.dss: 269 value = (self.dss >> 10) & 3 270 if value == 0: 271 return None # Feature not supported by this device 272 return CleanFluidStatus(value) 273 return None 274 275 @property 276 def hatch_door_status(self) -> int | None: 277 if self.dss: 278 return (self.dss >> 12) & 7 279 return None 280 281 @property 282 def dock_cool_fan_status(self) -> int | None: 283 if self.dss: 284 return (self.dss >> 15) & 3 285 return None 286 287 def __repr__(self) -> str: 288 return _attr_repr(self) 289 290 291@dataclass 292class StatusV2(RoborockBase): 293 """ 294 This is a new version of the Status object. 295 This is the result of GET_STATUS from the api. 296 """ 297 298 msg_ver: int | None = None 299 msg_seq: int | None = None 300 state: RoborockStateCode | None = field(default=None, metadata={"dps": RoborockDataProtocol.STATE}) 301 battery: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.BATTERY}) 302 clean_time: int | None = None 303 clean_area: int | None = None 304 error_code: RoborockErrorCode | None = field(default=None, metadata={"dps": RoborockDataProtocol.ERROR_CODE}) 305 map_present: int | None = None 306 in_cleaning: RoborockInCleaning | None = None 307 in_returning: int | None = None 308 in_fresh_state: int | None = None 309 lab_status: int | None = None 310 water_box_status: int | None = None 311 back_type: int | None = None 312 wash_phase: int | None = None 313 wash_ready: int | None = None 314 fan_power: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.FAN_POWER}) 315 dnd_enabled: int | None = None 316 map_status: int | None = None 317 is_locating: int | None = None 318 lock_status: int | None = None 319 water_box_mode: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.WATER_BOX_MODE}) 320 water_box_carriage_status: int | None = None 321 mop_forbidden_enable: int | None = None 322 camera_status: int | None = None 323 is_exploring: int | None = None 324 home_sec_status: int | None = None 325 home_sec_enable_password: int | None = None 326 adbumper_status: list[int] | None = None 327 water_shortage_status: int | None = None 328 dock_type: RoborockDockTypeCode | None = None 329 dust_collection_status: int | None = None 330 auto_dust_collection: int | None = None 331 avoid_count: int | None = None 332 mop_mode: int | None = None 333 debug_mode: int | None = None 334 collision_avoid_status: int | None = None 335 switch_map_mode: int | None = None 336 dock_error_status: RoborockDockErrorCode | None = None 337 charge_status: RoborockChargeStatus | None = field( 338 default=None, metadata={"dps": RoborockDataProtocol.CHARGE_STATUS} 339 ) 340 unsave_map_reason: int | None = None 341 unsave_map_flag: int | None = None 342 wash_status: int | None = None 343 distance_off: int | None = None 344 in_warmup: int | None = None 345 dry_status: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.DRYING_STATUS}) 346 rdt: int | None = None 347 clean_percent: int | None = None 348 rss: int | None = None 349 dss: int | None = None 350 common_status: int | None = None 351 corner_clean_mode: int | None = None 352 last_clean_t: int | None = None 353 replenish_mode: int | None = None 354 repeat: int | None = None 355 kct: int | None = None 356 subdivision_sets: int | None = None 357 358 @property 359 def square_meter_clean_area(self) -> float | None: 360 return round(self.clean_area / 1000000, 1) if self.clean_area is not None else None 361 362 @property 363 def error_code_name(self) -> str | None: 364 return self.error_code.name if self.error_code is not None else None 365 366 @property 367 def state_name(self) -> str | None: 368 return self.state.name if self.state is not None else None 369 370 @property 371 def current_map(self) -> int | None: 372 """Returns the current map ID if the map is present.""" 373 if self.map_status is not None: 374 map_flag = self.map_status >> 2 375 if map_flag != NO_MAP: 376 return map_flag 377 return None 378 379 @property 380 def clear_water_box_status(self) -> ClearWaterBoxStatus | None: 381 if self.dss: 382 return ClearWaterBoxStatus((self.dss >> 2) & 3) 383 return None 384 385 @property 386 def dirty_water_box_status(self) -> DirtyWaterBoxStatus | None: 387 if self.dss: 388 return DirtyWaterBoxStatus((self.dss >> 4) & 3) 389 return None 390 391 @property 392 def dust_bag_status(self) -> DustBagStatus | None: 393 if self.dss: 394 return DustBagStatus((self.dss >> 6) & 3) 395 return None 396 397 @property 398 def water_box_filter_status(self) -> int | None: 399 if self.dss: 400 return (self.dss >> 8) & 3 401 return None 402 403 @property 404 def clean_fluid_status(self) -> CleanFluidStatus | None: 405 if self.dss: 406 value = (self.dss >> 10) & 3 407 if value == 0: 408 return None # Feature not supported by this device 409 return CleanFluidStatus(value) 410 return None 411 412 @property 413 def hatch_door_status(self) -> int | None: 414 if self.dss: 415 return (self.dss >> 12) & 7 416 return None 417 418 @property 419 def dock_cool_fan_status(self) -> int | None: 420 if self.dss: 421 return (self.dss >> 15) & 3 422 return None 423 424 @property 425 def dock_state(self) -> RoborockDockState: 426 """A synthesized, high-level dock state reflecting the UI's display. 427 428 This property simplifies integration by handling the complex logic 429 of checking state, charge_status, and battery level simultaneously. It handles 430 newer off-peak charging logic seamlessly while maintaining backwards compatibility 431 with older devices. 432 """ 433 if self.state is None or self.state == RoborockStateCode.unknown: 434 return RoborockDockState.unknown 435 436 # 6. DUSTING 437 if self.state == RoborockStateCode.emptying_the_bin: 438 return RoborockDockState.dusting 439 440 # 5. FULL 441 if self.state == RoborockStateCode.charging_complete or ( 442 self.state == RoborockStateCode.charging and self.battery == 100 443 ): 444 return RoborockDockState.full 445 446 # 3 & 4. CHARGING and CHARGE_WAITING 447 if self.state == RoborockStateCode.charging: 448 if self.charge_status == RoborockChargeStatus.charge_waiting: 449 return RoborockDockState.off_peak_waiting 450 return RoborockDockState.charging 451 452 # 2. RECHARGING 453 if self.state in (RoborockStateCode.returning_home, RoborockStateCode.docking): 454 return RoborockDockState.returning 455 456 # 1. IDLE (Not on dock, or doing something else) 457 return RoborockDockState.idle 458 459 def __repr__(self) -> str: 460 return _attr_repr(self) 461 462 463@dataclass 464class S4MaxStatus(Status): 465 fan_power: RoborockFanSpeedS6Pure | None = None 466 water_box_mode: RoborockMopIntensityS7 | None = None 467 mop_mode: RoborockMopModeS7 | None = None 468 469 470@dataclass 471class S5MaxStatus(Status): 472 fan_power: RoborockFanSpeedS6Pure | None = None 473 water_box_mode: RoborockMopIntensityS5Max | None = None 474 475 476@dataclass 477class Q7MaxStatus(Status): 478 fan_power: RoborockFanSpeedQ7Max | None = None 479 water_box_mode: RoborockMopIntensityQ7Max | None = None 480 481 482@dataclass 483class QRevoMasterStatus(Status): 484 fan_power: RoborockFanSpeedQRevoMaster | None = None 485 water_box_mode: RoborockMopIntensityQRevoMaster | None = None 486 mop_mode: RoborockMopModeQRevoMaster | None = None 487 488 489@dataclass 490class QRevoCurvStatus(Status): 491 fan_power: RoborockFanSpeedQRevoCurv | None = None 492 water_box_mode: RoborockMopIntensityQRevoCurv | None = None 493 mop_mode: RoborockMopModeQRevoCurv | None = None 494 495 496@dataclass 497class QRevoMaxVStatus(Status): 498 fan_power: RoborockFanSpeedQRevoMaxV | None = None 499 water_box_mode: RoborockMopIntensityQRevoMaxV | None = None 500 mop_mode: RoborockMopModeQRevoMaxV | None = None 501 502 503@dataclass 504class S6MaxVStatus(Status): 505 fan_power: RoborockFanSpeedS7MaxV | None = None 506 water_box_mode: RoborockMopIntensityS6MaxV | None = None 507 508 509@dataclass 510class S6PureStatus(Status): 511 fan_power: RoborockFanSpeedS6Pure | None = None 512 513 514@dataclass 515class S7MaxVStatus(Status): 516 fan_power: RoborockFanSpeedS7MaxV | None = None 517 water_box_mode: RoborockMopIntensityS7 | None = None 518 mop_mode: RoborockMopModeS7 | None = None 519 520 521@dataclass 522class S7Status(Status): 523 fan_power: RoborockFanSpeedS7 | None = None 524 water_box_mode: RoborockMopIntensityS7 | None = None 525 mop_mode: RoborockMopModeS7 | None = None 526 527 528@dataclass 529class S8ProUltraStatus(Status): 530 fan_power: RoborockFanSpeedS7MaxV | None = None 531 water_box_mode: RoborockMopIntensityS7 | None = None 532 mop_mode: RoborockMopModeS8ProUltra | None = None 533 534 535@dataclass 536class S8Status(Status): 537 fan_power: RoborockFanSpeedS7MaxV | None = None 538 water_box_mode: RoborockMopIntensityS7 | None = None 539 mop_mode: RoborockMopModeS8ProUltra | None = None 540 541 542@dataclass 543class P10Status(Status): 544 fan_power: RoborockFanSpeedP10 | None = None 545 water_box_mode: RoborockMopIntensityP10 | None = None 546 mop_mode: RoborockMopModeS8ProUltra | None = None 547 548 549@dataclass 550class S8MaxvUltraStatus(Status): 551 fan_power: RoborockFanSpeedS8MaxVUltra | None = None 552 water_box_mode: RoborockMopIntensityS8MaxVUltra | None = None 553 mop_mode: RoborockMopModeS8MaxVUltra | None = None 554 555 556@dataclass 557class Saros10RStatus(Status): 558 fan_power: RoborockFanSpeedSaros10R | None = None 559 water_box_mode: RoborockMopIntensitySaros10R | None = None 560 mop_mode: RoborockMopModeSaros10R | None = None 561 562 563@dataclass 564class Saros10Status(Status): 565 fan_power: RoborockFanSpeedSaros10 | None = None 566 water_box_mode: RoborockMopIntensitySaros10 | None = None 567 mop_mode: RoborockMopModeSaros10 | None = None 568 569 570ModelStatus: dict[str, type[Status]] = { 571 ROBOROCK_S4_MAX: S4MaxStatus, 572 ROBOROCK_S5_MAX: S5MaxStatus, 573 ROBOROCK_Q7_MAX: Q7MaxStatus, 574 ROBOROCK_QREVO_MASTER: QRevoMasterStatus, 575 ROBOROCK_QREVO_CURV: QRevoCurvStatus, 576 ROBOROCK_S6: S6PureStatus, 577 ROBOROCK_S6_MAXV: S6MaxVStatus, 578 ROBOROCK_S6_PURE: S6PureStatus, 579 ROBOROCK_S7_MAXV: S7MaxVStatus, 580 ROBOROCK_S7: S7Status, 581 ROBOROCK_S8: S8Status, 582 ROBOROCK_S8_PRO_ULTRA: S8ProUltraStatus, 583 ROBOROCK_G10S_PRO: S7MaxVStatus, 584 ROBOROCK_G20S_Ultra: QRevoMasterStatus, 585 ROBOROCK_P10: P10Status, 586 # These likely are not correct, 587 # but i am currently unable to do my typical reverse engineering/ get any data from users on this, 588 # so this will be here in the mean time. 589 ROBOROCK_QREVO_S: P10Status, 590 ROBOROCK_QREVO_MAXV: QRevoMaxVStatus, 591 ROBOROCK_QREVO_PRO: P10Status, 592 ROBOROCK_S8_MAXV_ULTRA: S8MaxvUltraStatus, 593 ROBOROCK_SAROS_10R: Saros10RStatus, 594 ROBOROCK_SAROS_10: Saros10Status, 595} 596 597 598@dataclass 599class DnDTimer(RoborockBaseTimer): 600 """DnDTimer""" 601 602 603@dataclass 604class ValleyElectricityTimer(RoborockBaseTimer): 605 """ValleyElectricityTimer""" 606 607 608@dataclass 609class CleanSummary(RoborockBase): 610 clean_time: int | None = None 611 clean_area: int | None = None 612 clean_count: int | None = None 613 dust_collection_count: int | None = None 614 records: list[int] | None = None 615 last_clean_t: int | None = None 616 617 @property 618 def square_meter_clean_area(self) -> float | None: 619 """Returns the clean area in square meters.""" 620 if isinstance(self.clean_area, list | str): 621 _LOGGER.warning(f"Clean area is a unexpected type! Please give the following in a issue: {self.clean_area}") 622 return None 623 return round(self.clean_area / 1000000, 1) if self.clean_area is not None else None 624 625 def __repr__(self) -> str: 626 """Return a string representation of the object including all attributes.""" 627 return _attr_repr(self) 628 629 630@dataclass 631class CleanRecord(RoborockBase): 632 begin: int | None = None 633 end: int | None = None 634 duration: int | None = None 635 area: int | None = None 636 error: int | None = None 637 complete: int | None = None 638 start_type: RoborockStartType | None = None 639 clean_type: RoborockCleanType | None = None 640 finish_reason: RoborockFinishReason | None = None 641 dust_collection_status: int | None = None 642 avoid_count: int | None = None 643 wash_count: int | None = None 644 map_flag: int | None = None 645 646 @property 647 def square_meter_area(self) -> float | None: 648 return round(self.area / 1000000, 1) if self.area is not None else None 649 650 @property 651 def begin_datetime(self) -> datetime.datetime | None: 652 return datetime.datetime.fromtimestamp(self.begin).astimezone(datetime.UTC) if self.begin else None 653 654 @property 655 def end_datetime(self) -> datetime.datetime | None: 656 return datetime.datetime.fromtimestamp(self.end).astimezone(datetime.UTC) if self.end else None 657 658 def __repr__(self) -> str: 659 return _attr_repr(self) 660 661 662class CleanSummaryWithDetail(CleanSummary): 663 """CleanSummary with the last CleanRecord included.""" 664 665 last_clean_record: CleanRecord | None = None 666 667 668class ConsumableField(FieldNameBase): 669 """An enum that represents a field in the `Consumable` class. 670 671 This is used with `roborock.devices.traits.v1.status.DeviceFeaturesTrait` 672 to understand if a feature is supported by the device using `is_field_supported`. 673 674 The enum values are names of fields in the `Consumable` class. Each field is 675 annotated with `dps` metadata to map the field to a `RoborockDataProtocol` 676 value used to check support against the product schema. 677 """ 678 679 MAIN_BRUSH_WORK_TIME = "main_brush_work_time" 680 SIDE_BRUSH_WORK_TIME = "side_brush_work_time" 681 FILTER_WORK_TIME = "filter_work_time" 682 683 684@dataclass 685class Consumable(RoborockBase): 686 main_brush_work_time: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.MAIN_BRUSH_WORK_TIME}) 687 side_brush_work_time: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.SIDE_BRUSH_WORK_TIME}) 688 filter_work_time: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.FILTER_WORK_TIME}) 689 filter_element_work_time: int | None = None 690 sensor_dirty_time: int | None = None 691 strainer_work_times: int | None = None 692 dust_collection_work_times: int | None = None 693 cleaning_brush_work_times: int | None = None 694 moproller_work_time: int | None = None 695 696 @property 697 def main_brush_time_left(self) -> int | None: 698 return MAIN_BRUSH_REPLACE_TIME - self.main_brush_work_time if self.main_brush_work_time is not None else None 699 700 @property 701 def side_brush_time_left(self) -> int | None: 702 return SIDE_BRUSH_REPLACE_TIME - self.side_brush_work_time if self.side_brush_work_time is not None else None 703 704 @property 705 def filter_time_left(self) -> int | None: 706 return FILTER_REPLACE_TIME - self.filter_work_time if self.filter_work_time is not None else None 707 708 @property 709 def sensor_time_left(self) -> int | None: 710 return SENSOR_DIRTY_REPLACE_TIME - self.sensor_dirty_time if self.sensor_dirty_time is not None else None 711 712 @property 713 def strainer_time_left(self) -> int | None: 714 return STRAINER_REPLACE_TIME - self.strainer_work_times if self.strainer_work_times is not None else None 715 716 @property 717 def dust_collection_time_left(self) -> int | None: 718 return ( 719 DUST_COLLECTION_REPLACE_TIME - self.dust_collection_work_times 720 if self.dust_collection_work_times is not None 721 else None 722 ) 723 724 @property 725 def cleaning_brush_time_left(self) -> int | None: 726 return ( 727 CLEANING_BRUSH_REPLACE_TIME - self.cleaning_brush_work_times 728 if self.cleaning_brush_work_times is not None 729 else None 730 ) 731 732 @property 733 def mop_roller_time_left(self) -> int | None: 734 return MOP_ROLLER_REPLACE_TIME - self.moproller_work_time if self.moproller_work_time is not None else None 735 736 def __repr__(self) -> str: 737 return _attr_repr(self) 738 739 740@dataclass 741class MultiMapsListRoom(RoborockBase): 742 id: int | None = None 743 tag: int | None = None 744 iot_name_id: str | None = None 745 iot_name: str | None = None 746 747 @property 748 def named_room_mapping(self) -> NamedRoomMapping | None: 749 """Returns a NamedRoomMapping object if valid.""" 750 if self.id is None or self.iot_name_id is None: 751 return None 752 return NamedRoomMapping( 753 segment_id=self.id, 754 iot_id=self.iot_name_id, 755 raw_name=self.iot_name, 756 ) 757 758 759@dataclass 760class MultiMapsListMapInfoBakMaps(RoborockBase): 761 mapflag: Any | None = None 762 add_time: Any | None = None 763 764 765@dataclass 766class MultiMapsListMapInfo(RoborockBase): 767 map_flag: int 768 name: str 769 add_time: Any | None = None 770 length: Any | None = None 771 bak_maps: list[MultiMapsListMapInfoBakMaps] | None = None 772 rooms: list[MultiMapsListRoom] | None = None 773 774 @property 775 def mapFlag(self) -> int: 776 """Alias for map_flag, returns the map flag as an integer.""" 777 return self.map_flag 778 779 @property 780 def rooms_map(self) -> dict[int, NamedRoomMapping]: 781 """Returns a dictionary of room mappings by segment id.""" 782 return { 783 room.id: mapping 784 for room in self.rooms or () 785 if room.id is not None and (mapping := room.named_room_mapping) is not None 786 } 787 788 789@dataclass 790class MultiMapsList(RoborockBase): 791 max_multi_map: int | None = None 792 max_bak_map: int | None = None 793 multi_map_count: int | None = None 794 map_info: list[MultiMapsListMapInfo] | None = None 795 796 797@dataclass 798class SmartWashParams(RoborockBase): 799 smart_wash: int | None = None 800 wash_interval: int | None = None 801 802 803@dataclass 804class DustCollectionMode(RoborockBase): 805 mode: RoborockDockDustCollectionModeCode | None = None 806 807 808@dataclass 809class WashTowelMode(RoborockBase): 810 wash_mode: WashTowelModes | None = None 811 812 813@dataclass 814class NetworkInfo(RoborockBase): 815 ip: str 816 ssid: str | None = None 817 mac: str | None = None 818 bssid: str | None = None 819 rssi: int | None = None 820 821 822@dataclass 823class AppInitStatusLocalInfo(RoborockBase): 824 location: str 825 bom: str | None = None 826 featureset: int | None = None 827 language: str | None = None 828 logserver: str | None = None 829 wifiplan: str | None = None 830 timezone: str | None = None 831 name: str | None = None 832 833 834@dataclass 835class AppInitStatus(RoborockBase): 836 local_info: AppInitStatusLocalInfo 837 feature_info: list[int] 838 new_feature_info: int = 0 839 new_feature_info_str: str = "" 840 new_feature_info_2: int | None = None 841 carriage_type: int | None = None 842 dsp_version: str | None = None 843 844 845@dataclass 846class ChildLockStatus(RoborockBase): 847 lock_status: int = 0 848 849 850@dataclass 851class FlowLedStatus(RoborockBase): 852 status: int = 0 853 854 855@dataclass 856class LedStatus(RoborockBase): 857 status: int = 0
99class FieldNameBase(StrEnum): 100 """A base enum class that represents a field name in a RoborockBase dataclass."""
A base enum class that represents a field name in a RoborockBase dataclass.
103class StatusField(FieldNameBase): 104 """An enum that represents a field in the `StatusV2` class. 105 106 This is used with `roborock.devices.traits.v1.status.DeviceFeaturesTrait` 107 to understand if a feature is supported by the device using `is_field_supported`. 108 109 The enum values are names of fields in the `StatusV2` class. Each field is 110 annotated with `dps` metadata to map the field to a `RoborockDataProtocol` 111 value used to check support against the product schema. 112 """ 113 114 STATE = "state" 115 BATTERY = "battery" 116 FAN_POWER = "fan_power" 117 WATER_BOX_MODE = "water_box_mode" 118 CHARGE_STATUS = "charge_status" 119 DRY_STATUS = "dry_status" 120 ERROR_CODE = "error_code"
An enum that represents a field in the StatusV2 class.
This is used with roborock.devices.traits.v1.status.DeviceFeaturesTrait
to understand if a feature is supported by the device using is_field_supported.
The enum values are names of fields in the StatusV2 class. Each field is
annotated with dps metadata to map the field to a RoborockDataProtocol
value used to check support against the product schema.
123@dataclass 124class Status(RoborockBase): 125 """This status will be deprecated in favor of StatusV2.""" 126 127 msg_ver: int | None = None 128 msg_seq: int | None = None 129 state: RoborockStateCode | None = field(default=None, metadata={"dps": RoborockDataProtocol.STATE}) 130 battery: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.BATTERY}) 131 clean_time: int | None = None 132 clean_area: int | None = None 133 error_code: RoborockErrorCode | None = field(default=None, metadata={"dps": RoborockDataProtocol.ERROR_CODE}) 134 map_present: int | None = None 135 in_cleaning: RoborockInCleaning | None = None 136 in_returning: int | None = None 137 in_fresh_state: int | None = None 138 lab_status: int | None = None 139 water_box_status: int | None = None 140 back_type: int | None = None 141 wash_phase: int | None = None 142 wash_ready: int | None = None 143 fan_power: RoborockFanPowerCode | None = field(default=None, metadata={"dps": RoborockDataProtocol.FAN_POWER}) 144 dnd_enabled: int | None = None 145 map_status: int | None = None 146 is_locating: int | None = None 147 lock_status: int | None = None 148 water_box_mode: RoborockMopIntensityCode | None = field( 149 default=None, metadata={"dps": RoborockDataProtocol.WATER_BOX_MODE} 150 ) 151 water_box_carriage_status: int | None = None 152 mop_forbidden_enable: int | None = None 153 camera_status: int | None = None 154 is_exploring: int | None = None 155 home_sec_status: int | None = None 156 home_sec_enable_password: int | None = None 157 adbumper_status: list[int] | None = None 158 water_shortage_status: int | None = None 159 dock_type: RoborockDockTypeCode | None = None 160 dust_collection_status: int | None = None 161 auto_dust_collection: int | None = None 162 avoid_count: int | None = None 163 mop_mode: RoborockMopModeCode | None = None 164 debug_mode: int | None = None 165 collision_avoid_status: int | None = None 166 switch_map_mode: int | None = None 167 dock_error_status: RoborockDockErrorCode | None = None 168 charge_status: RoborockChargeStatus | None = field( 169 default=None, metadata={"dps": RoborockDataProtocol.CHARGE_STATUS} 170 ) 171 unsave_map_reason: int | None = None 172 unsave_map_flag: int | None = None 173 wash_status: int | None = None 174 distance_off: int | None = None 175 in_warmup: int | None = None 176 dry_status: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.DRYING_STATUS}) 177 rdt: int | None = None 178 clean_percent: int | None = None 179 rss: int | None = None 180 dss: int | None = None 181 common_status: int | None = None 182 corner_clean_mode: int | None = None 183 last_clean_t: int | None = None 184 replenish_mode: int | None = None 185 repeat: int | None = None 186 kct: int | None = None 187 subdivision_sets: int | None = None 188 189 @property 190 def square_meter_clean_area(self) -> float | None: 191 return round(self.clean_area / 1000000, 1) if self.clean_area is not None else None 192 193 @property 194 def error_code_name(self) -> str | None: 195 return self.error_code.name if self.error_code is not None else None 196 197 @property 198 def state_name(self) -> str | None: 199 return self.state.name if self.state is not None else None 200 201 @property 202 def water_box_mode_name(self) -> str | None: 203 return self.water_box_mode.name if self.water_box_mode is not None else None 204 205 @property 206 def fan_power_options(self) -> list[str]: 207 if self.fan_power is None: 208 return [] 209 return list(self.fan_power.keys()) 210 211 @property 212 def fan_power_name(self) -> str | None: 213 return self.fan_power.name if self.fan_power is not None else None 214 215 @property 216 def mop_mode_name(self) -> str | None: 217 return self.mop_mode.name if self.mop_mode is not None else None 218 219 def get_fan_speed_code(self, fan_speed: str) -> int: 220 if self.fan_power is None: 221 raise RoborockException("Attempted to get fan speed before status has been updated.") 222 return self.fan_power.as_dict().get(fan_speed) 223 224 def get_mop_intensity_code(self, mop_intensity: str) -> int: 225 if self.water_box_mode is None: 226 raise RoborockException("Attempted to get mop_intensity before status has been updated.") 227 return self.water_box_mode.as_dict().get(mop_intensity) 228 229 def get_mop_mode_code(self, mop_mode: str) -> int: 230 if self.mop_mode is None: 231 raise RoborockException("Attempted to get mop_mode before status has been updated.") 232 return self.mop_mode.as_dict().get(mop_mode) 233 234 @property 235 def current_map(self) -> int | None: 236 """Returns the current map ID if the map is present.""" 237 if self.map_status is not None: 238 map_flag = self.map_status >> 2 239 if map_flag != NO_MAP: 240 return map_flag 241 return None 242 243 @property 244 def clear_water_box_status(self) -> ClearWaterBoxStatus | None: 245 if self.dss: 246 return ClearWaterBoxStatus((self.dss >> 2) & 3) 247 return None 248 249 @property 250 def dirty_water_box_status(self) -> DirtyWaterBoxStatus | None: 251 if self.dss: 252 return DirtyWaterBoxStatus((self.dss >> 4) & 3) 253 return None 254 255 @property 256 def dust_bag_status(self) -> DustBagStatus | None: 257 if self.dss: 258 return DustBagStatus((self.dss >> 6) & 3) 259 return None 260 261 @property 262 def water_box_filter_status(self) -> int | None: 263 if self.dss: 264 return (self.dss >> 8) & 3 265 return None 266 267 @property 268 def clean_fluid_status(self) -> CleanFluidStatus | None: 269 if self.dss: 270 value = (self.dss >> 10) & 3 271 if value == 0: 272 return None # Feature not supported by this device 273 return CleanFluidStatus(value) 274 return None 275 276 @property 277 def hatch_door_status(self) -> int | None: 278 if self.dss: 279 return (self.dss >> 12) & 7 280 return None 281 282 @property 283 def dock_cool_fan_status(self) -> int | None: 284 if self.dss: 285 return (self.dss >> 15) & 3 286 return None 287 288 def __repr__(self) -> str: 289 return _attr_repr(self)
This status will be deprecated in favor of StatusV2.
234 @property 235 def current_map(self) -> int | None: 236 """Returns the current map ID if the map is present.""" 237 if self.map_status is not None: 238 map_flag = self.map_status >> 2 239 if map_flag != NO_MAP: 240 return map_flag 241 return None
Returns the current map ID if the map is present.
Inherited Members
292@dataclass 293class StatusV2(RoborockBase): 294 """ 295 This is a new version of the Status object. 296 This is the result of GET_STATUS from the api. 297 """ 298 299 msg_ver: int | None = None 300 msg_seq: int | None = None 301 state: RoborockStateCode | None = field(default=None, metadata={"dps": RoborockDataProtocol.STATE}) 302 battery: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.BATTERY}) 303 clean_time: int | None = None 304 clean_area: int | None = None 305 error_code: RoborockErrorCode | None = field(default=None, metadata={"dps": RoborockDataProtocol.ERROR_CODE}) 306 map_present: int | None = None 307 in_cleaning: RoborockInCleaning | None = None 308 in_returning: int | None = None 309 in_fresh_state: int | None = None 310 lab_status: int | None = None 311 water_box_status: int | None = None 312 back_type: int | None = None 313 wash_phase: int | None = None 314 wash_ready: int | None = None 315 fan_power: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.FAN_POWER}) 316 dnd_enabled: int | None = None 317 map_status: int | None = None 318 is_locating: int | None = None 319 lock_status: int | None = None 320 water_box_mode: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.WATER_BOX_MODE}) 321 water_box_carriage_status: int | None = None 322 mop_forbidden_enable: int | None = None 323 camera_status: int | None = None 324 is_exploring: int | None = None 325 home_sec_status: int | None = None 326 home_sec_enable_password: int | None = None 327 adbumper_status: list[int] | None = None 328 water_shortage_status: int | None = None 329 dock_type: RoborockDockTypeCode | None = None 330 dust_collection_status: int | None = None 331 auto_dust_collection: int | None = None 332 avoid_count: int | None = None 333 mop_mode: int | None = None 334 debug_mode: int | None = None 335 collision_avoid_status: int | None = None 336 switch_map_mode: int | None = None 337 dock_error_status: RoborockDockErrorCode | None = None 338 charge_status: RoborockChargeStatus | None = field( 339 default=None, metadata={"dps": RoborockDataProtocol.CHARGE_STATUS} 340 ) 341 unsave_map_reason: int | None = None 342 unsave_map_flag: int | None = None 343 wash_status: int | None = None 344 distance_off: int | None = None 345 in_warmup: int | None = None 346 dry_status: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.DRYING_STATUS}) 347 rdt: int | None = None 348 clean_percent: int | None = None 349 rss: int | None = None 350 dss: int | None = None 351 common_status: int | None = None 352 corner_clean_mode: int | None = None 353 last_clean_t: int | None = None 354 replenish_mode: int | None = None 355 repeat: int | None = None 356 kct: int | None = None 357 subdivision_sets: int | None = None 358 359 @property 360 def square_meter_clean_area(self) -> float | None: 361 return round(self.clean_area / 1000000, 1) if self.clean_area is not None else None 362 363 @property 364 def error_code_name(self) -> str | None: 365 return self.error_code.name if self.error_code is not None else None 366 367 @property 368 def state_name(self) -> str | None: 369 return self.state.name if self.state is not None else None 370 371 @property 372 def current_map(self) -> int | None: 373 """Returns the current map ID if the map is present.""" 374 if self.map_status is not None: 375 map_flag = self.map_status >> 2 376 if map_flag != NO_MAP: 377 return map_flag 378 return None 379 380 @property 381 def clear_water_box_status(self) -> ClearWaterBoxStatus | None: 382 if self.dss: 383 return ClearWaterBoxStatus((self.dss >> 2) & 3) 384 return None 385 386 @property 387 def dirty_water_box_status(self) -> DirtyWaterBoxStatus | None: 388 if self.dss: 389 return DirtyWaterBoxStatus((self.dss >> 4) & 3) 390 return None 391 392 @property 393 def dust_bag_status(self) -> DustBagStatus | None: 394 if self.dss: 395 return DustBagStatus((self.dss >> 6) & 3) 396 return None 397 398 @property 399 def water_box_filter_status(self) -> int | None: 400 if self.dss: 401 return (self.dss >> 8) & 3 402 return None 403 404 @property 405 def clean_fluid_status(self) -> CleanFluidStatus | None: 406 if self.dss: 407 value = (self.dss >> 10) & 3 408 if value == 0: 409 return None # Feature not supported by this device 410 return CleanFluidStatus(value) 411 return None 412 413 @property 414 def hatch_door_status(self) -> int | None: 415 if self.dss: 416 return (self.dss >> 12) & 7 417 return None 418 419 @property 420 def dock_cool_fan_status(self) -> int | None: 421 if self.dss: 422 return (self.dss >> 15) & 3 423 return None 424 425 @property 426 def dock_state(self) -> RoborockDockState: 427 """A synthesized, high-level dock state reflecting the UI's display. 428 429 This property simplifies integration by handling the complex logic 430 of checking state, charge_status, and battery level simultaneously. It handles 431 newer off-peak charging logic seamlessly while maintaining backwards compatibility 432 with older devices. 433 """ 434 if self.state is None or self.state == RoborockStateCode.unknown: 435 return RoborockDockState.unknown 436 437 # 6. DUSTING 438 if self.state == RoborockStateCode.emptying_the_bin: 439 return RoborockDockState.dusting 440 441 # 5. FULL 442 if self.state == RoborockStateCode.charging_complete or ( 443 self.state == RoborockStateCode.charging and self.battery == 100 444 ): 445 return RoborockDockState.full 446 447 # 3 & 4. CHARGING and CHARGE_WAITING 448 if self.state == RoborockStateCode.charging: 449 if self.charge_status == RoborockChargeStatus.charge_waiting: 450 return RoborockDockState.off_peak_waiting 451 return RoborockDockState.charging 452 453 # 2. RECHARGING 454 if self.state in (RoborockStateCode.returning_home, RoborockStateCode.docking): 455 return RoborockDockState.returning 456 457 # 1. IDLE (Not on dock, or doing something else) 458 return RoborockDockState.idle 459 460 def __repr__(self) -> str: 461 return _attr_repr(self)
This is a new version of the Status object. This is the result of GET_STATUS from the api.
371 @property 372 def current_map(self) -> int | None: 373 """Returns the current map ID if the map is present.""" 374 if self.map_status is not None: 375 map_flag = self.map_status >> 2 376 if map_flag != NO_MAP: 377 return map_flag 378 return None
Returns the current map ID if the map is present.
425 @property 426 def dock_state(self) -> RoborockDockState: 427 """A synthesized, high-level dock state reflecting the UI's display. 428 429 This property simplifies integration by handling the complex logic 430 of checking state, charge_status, and battery level simultaneously. It handles 431 newer off-peak charging logic seamlessly while maintaining backwards compatibility 432 with older devices. 433 """ 434 if self.state is None or self.state == RoborockStateCode.unknown: 435 return RoborockDockState.unknown 436 437 # 6. DUSTING 438 if self.state == RoborockStateCode.emptying_the_bin: 439 return RoborockDockState.dusting 440 441 # 5. FULL 442 if self.state == RoborockStateCode.charging_complete or ( 443 self.state == RoborockStateCode.charging and self.battery == 100 444 ): 445 return RoborockDockState.full 446 447 # 3 & 4. CHARGING and CHARGE_WAITING 448 if self.state == RoborockStateCode.charging: 449 if self.charge_status == RoborockChargeStatus.charge_waiting: 450 return RoborockDockState.off_peak_waiting 451 return RoborockDockState.charging 452 453 # 2. RECHARGING 454 if self.state in (RoborockStateCode.returning_home, RoborockStateCode.docking): 455 return RoborockDockState.returning 456 457 # 1. IDLE (Not on dock, or doing something else) 458 return RoborockDockState.idle
A synthesized, high-level dock state reflecting the UI's display.
This property simplifies integration by handling the complex logic of checking state, charge_status, and battery level simultaneously. It handles newer off-peak charging logic seamlessly while maintaining backwards compatibility with older devices.
Inherited Members
464@dataclass 465class S4MaxStatus(Status): 466 fan_power: RoborockFanSpeedS6Pure | None = None 467 water_box_mode: RoborockMopIntensityS7 | None = None 468 mop_mode: RoborockMopModeS7 | None = None
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
471@dataclass 472class S5MaxStatus(Status): 473 fan_power: RoborockFanSpeedS6Pure | None = None 474 water_box_mode: RoborockMopIntensityS5Max | None = None
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- mop_mode
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
477@dataclass 478class Q7MaxStatus(Status): 479 fan_power: RoborockFanSpeedQ7Max | None = None 480 water_box_mode: RoborockMopIntensityQ7Max | None = None
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- mop_mode
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
483@dataclass 484class QRevoMasterStatus(Status): 485 fan_power: RoborockFanSpeedQRevoMaster | None = None 486 water_box_mode: RoborockMopIntensityQRevoMaster | None = None 487 mop_mode: RoborockMopModeQRevoMaster | None = None
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
490@dataclass 491class QRevoCurvStatus(Status): 492 fan_power: RoborockFanSpeedQRevoCurv | None = None 493 water_box_mode: RoborockMopIntensityQRevoCurv | None = None 494 mop_mode: RoborockMopModeQRevoCurv | None = None
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
497@dataclass 498class QRevoMaxVStatus(Status): 499 fan_power: RoborockFanSpeedQRevoMaxV | None = None 500 water_box_mode: RoborockMopIntensityQRevoMaxV | None = None 501 mop_mode: RoborockMopModeQRevoMaxV | None = None
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
504@dataclass 505class S6MaxVStatus(Status): 506 fan_power: RoborockFanSpeedS7MaxV | None = None 507 water_box_mode: RoborockMopIntensityS6MaxV | None = None
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- mop_mode
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_mode
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- mop_mode
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
515@dataclass 516class S7MaxVStatus(Status): 517 fan_power: RoborockFanSpeedS7MaxV | None = None 518 water_box_mode: RoborockMopIntensityS7 | None = None 519 mop_mode: RoborockMopModeS7 | None = None
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
522@dataclass 523class S7Status(Status): 524 fan_power: RoborockFanSpeedS7 | None = None 525 water_box_mode: RoborockMopIntensityS7 | None = None 526 mop_mode: RoborockMopModeS7 | None = None
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
529@dataclass 530class S8ProUltraStatus(Status): 531 fan_power: RoborockFanSpeedS7MaxV | None = None 532 water_box_mode: RoborockMopIntensityS7 | None = None 533 mop_mode: RoborockMopModeS8ProUltra | None = None
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
536@dataclass 537class S8Status(Status): 538 fan_power: RoborockFanSpeedS7MaxV | None = None 539 water_box_mode: RoborockMopIntensityS7 | None = None 540 mop_mode: RoborockMopModeS8ProUltra | None = None
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
543@dataclass 544class P10Status(Status): 545 fan_power: RoborockFanSpeedP10 | None = None 546 water_box_mode: RoborockMopIntensityP10 | None = None 547 mop_mode: RoborockMopModeS8ProUltra | None = None
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
550@dataclass 551class S8MaxvUltraStatus(Status): 552 fan_power: RoborockFanSpeedS8MaxVUltra | None = None 553 water_box_mode: RoborockMopIntensityS8MaxVUltra | None = None 554 mop_mode: RoborockMopModeS8MaxVUltra | None = None
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
557@dataclass 558class Saros10RStatus(Status): 559 fan_power: RoborockFanSpeedSaros10R | None = None 560 water_box_mode: RoborockMopIntensitySaros10R | None = None 561 mop_mode: RoborockMopModeSaros10R | None = None
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
564@dataclass 565class Saros10Status(Status): 566 fan_power: RoborockFanSpeedSaros10 | None = None 567 water_box_mode: RoborockMopIntensitySaros10 | None = None 568 mop_mode: RoborockMopModeSaros10 | None = None
Inherited Members
- Status
- msg_ver
- msg_seq
- state
- battery
- clean_time
- clean_area
- error_code
- map_present
- in_cleaning
- in_returning
- in_fresh_state
- lab_status
- water_box_status
- back_type
- wash_phase
- wash_ready
- dnd_enabled
- map_status
- is_locating
- lock_status
- water_box_carriage_status
- mop_forbidden_enable
- camera_status
- is_exploring
- home_sec_status
- home_sec_enable_password
- adbumper_status
- water_shortage_status
- dock_type
- dust_collection_status
- auto_dust_collection
- avoid_count
- debug_mode
- collision_avoid_status
- switch_map_mode
- dock_error_status
- charge_status
- unsave_map_reason
- unsave_map_flag
- wash_status
- distance_off
- in_warmup
- dry_status
- rdt
- clean_percent
- rss
- dss
- common_status
- corner_clean_mode
- last_clean_t
- replenish_mode
- repeat
- kct
- subdivision_sets
- square_meter_clean_area
- error_code_name
- state_name
- water_box_mode_name
- fan_power_options
- fan_power_name
- mop_mode_name
- get_fan_speed_code
- get_mop_intensity_code
- get_mop_mode_code
- current_map
- clear_water_box_status
- dirty_water_box_status
- dust_bag_status
- water_box_filter_status
- clean_fluid_status
- hatch_door_status
- dock_cool_fan_status
DnDTimer
ValleyElectricityTimer
609@dataclass 610class CleanSummary(RoborockBase): 611 clean_time: int | None = None 612 clean_area: int | None = None 613 clean_count: int | None = None 614 dust_collection_count: int | None = None 615 records: list[int] | None = None 616 last_clean_t: int | None = None 617 618 @property 619 def square_meter_clean_area(self) -> float | None: 620 """Returns the clean area in square meters.""" 621 if isinstance(self.clean_area, list | str): 622 _LOGGER.warning(f"Clean area is a unexpected type! Please give the following in a issue: {self.clean_area}") 623 return None 624 return round(self.clean_area / 1000000, 1) if self.clean_area is not None else None 625 626 def __repr__(self) -> str: 627 """Return a string representation of the object including all attributes.""" 628 return _attr_repr(self)
618 @property 619 def square_meter_clean_area(self) -> float | None: 620 """Returns the clean area in square meters.""" 621 if isinstance(self.clean_area, list | str): 622 _LOGGER.warning(f"Clean area is a unexpected type! Please give the following in a issue: {self.clean_area}") 623 return None 624 return round(self.clean_area / 1000000, 1) if self.clean_area is not None else None
Returns the clean area in square meters.
Inherited Members
631@dataclass 632class CleanRecord(RoborockBase): 633 begin: int | None = None 634 end: int | None = None 635 duration: int | None = None 636 area: int | None = None 637 error: int | None = None 638 complete: int | None = None 639 start_type: RoborockStartType | None = None 640 clean_type: RoborockCleanType | None = None 641 finish_reason: RoborockFinishReason | None = None 642 dust_collection_status: int | None = None 643 avoid_count: int | None = None 644 wash_count: int | None = None 645 map_flag: int | None = None 646 647 @property 648 def square_meter_area(self) -> float | None: 649 return round(self.area / 1000000, 1) if self.area is not None else None 650 651 @property 652 def begin_datetime(self) -> datetime.datetime | None: 653 return datetime.datetime.fromtimestamp(self.begin).astimezone(datetime.UTC) if self.begin else None 654 655 @property 656 def end_datetime(self) -> datetime.datetime | None: 657 return datetime.datetime.fromtimestamp(self.end).astimezone(datetime.UTC) if self.end else None 658 659 def __repr__(self) -> str: 660 return _attr_repr(self)
Inherited Members
663class CleanSummaryWithDetail(CleanSummary): 664 """CleanSummary with the last CleanRecord included.""" 665 666 last_clean_record: CleanRecord | None = None
CleanSummary with the last CleanRecord included.
669class ConsumableField(FieldNameBase): 670 """An enum that represents a field in the `Consumable` class. 671 672 This is used with `roborock.devices.traits.v1.status.DeviceFeaturesTrait` 673 to understand if a feature is supported by the device using `is_field_supported`. 674 675 The enum values are names of fields in the `Consumable` class. Each field is 676 annotated with `dps` metadata to map the field to a `RoborockDataProtocol` 677 value used to check support against the product schema. 678 """ 679 680 MAIN_BRUSH_WORK_TIME = "main_brush_work_time" 681 SIDE_BRUSH_WORK_TIME = "side_brush_work_time" 682 FILTER_WORK_TIME = "filter_work_time"
An enum that represents a field in the Consumable class.
This is used with roborock.devices.traits.v1.status.DeviceFeaturesTrait
to understand if a feature is supported by the device using is_field_supported.
The enum values are names of fields in the Consumable class. Each field is
annotated with dps metadata to map the field to a RoborockDataProtocol
value used to check support against the product schema.
685@dataclass 686class Consumable(RoborockBase): 687 main_brush_work_time: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.MAIN_BRUSH_WORK_TIME}) 688 side_brush_work_time: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.SIDE_BRUSH_WORK_TIME}) 689 filter_work_time: int | None = field(default=None, metadata={"dps": RoborockDataProtocol.FILTER_WORK_TIME}) 690 filter_element_work_time: int | None = None 691 sensor_dirty_time: int | None = None 692 strainer_work_times: int | None = None 693 dust_collection_work_times: int | None = None 694 cleaning_brush_work_times: int | None = None 695 moproller_work_time: int | None = None 696 697 @property 698 def main_brush_time_left(self) -> int | None: 699 return MAIN_BRUSH_REPLACE_TIME - self.main_brush_work_time if self.main_brush_work_time is not None else None 700 701 @property 702 def side_brush_time_left(self) -> int | None: 703 return SIDE_BRUSH_REPLACE_TIME - self.side_brush_work_time if self.side_brush_work_time is not None else None 704 705 @property 706 def filter_time_left(self) -> int | None: 707 return FILTER_REPLACE_TIME - self.filter_work_time if self.filter_work_time is not None else None 708 709 @property 710 def sensor_time_left(self) -> int | None: 711 return SENSOR_DIRTY_REPLACE_TIME - self.sensor_dirty_time if self.sensor_dirty_time is not None else None 712 713 @property 714 def strainer_time_left(self) -> int | None: 715 return STRAINER_REPLACE_TIME - self.strainer_work_times if self.strainer_work_times is not None else None 716 717 @property 718 def dust_collection_time_left(self) -> int | None: 719 return ( 720 DUST_COLLECTION_REPLACE_TIME - self.dust_collection_work_times 721 if self.dust_collection_work_times is not None 722 else None 723 ) 724 725 @property 726 def cleaning_brush_time_left(self) -> int | None: 727 return ( 728 CLEANING_BRUSH_REPLACE_TIME - self.cleaning_brush_work_times 729 if self.cleaning_brush_work_times is not None 730 else None 731 ) 732 733 @property 734 def mop_roller_time_left(self) -> int | None: 735 return MOP_ROLLER_REPLACE_TIME - self.moproller_work_time if self.moproller_work_time is not None else None 736 737 def __repr__(self) -> str: 738 return _attr_repr(self)
Inherited Members
741@dataclass 742class MultiMapsListRoom(RoborockBase): 743 id: int | None = None 744 tag: int | None = None 745 iot_name_id: str | None = None 746 iot_name: str | None = None 747 748 @property 749 def named_room_mapping(self) -> NamedRoomMapping | None: 750 """Returns a NamedRoomMapping object if valid.""" 751 if self.id is None or self.iot_name_id is None: 752 return None 753 return NamedRoomMapping( 754 segment_id=self.id, 755 iot_id=self.iot_name_id, 756 raw_name=self.iot_name, 757 )
748 @property 749 def named_room_mapping(self) -> NamedRoomMapping | None: 750 """Returns a NamedRoomMapping object if valid.""" 751 if self.id is None or self.iot_name_id is None: 752 return None 753 return NamedRoomMapping( 754 segment_id=self.id, 755 iot_id=self.iot_name_id, 756 raw_name=self.iot_name, 757 )
Returns a NamedRoomMapping object if valid.
Inherited Members
760@dataclass 761class MultiMapsListMapInfoBakMaps(RoborockBase): 762 mapflag: Any | None = None 763 add_time: Any | None = None
Inherited Members
766@dataclass 767class MultiMapsListMapInfo(RoborockBase): 768 map_flag: int 769 name: str 770 add_time: Any | None = None 771 length: Any | None = None 772 bak_maps: list[MultiMapsListMapInfoBakMaps] | None = None 773 rooms: list[MultiMapsListRoom] | None = None 774 775 @property 776 def mapFlag(self) -> int: 777 """Alias for map_flag, returns the map flag as an integer.""" 778 return self.map_flag 779 780 @property 781 def rooms_map(self) -> dict[int, NamedRoomMapping]: 782 """Returns a dictionary of room mappings by segment id.""" 783 return { 784 room.id: mapping 785 for room in self.rooms or () 786 if room.id is not None and (mapping := room.named_room_mapping) is not None 787 }
775 @property 776 def mapFlag(self) -> int: 777 """Alias for map_flag, returns the map flag as an integer.""" 778 return self.map_flag
Alias for map_flag, returns the map flag as an integer.
780 @property 781 def rooms_map(self) -> dict[int, NamedRoomMapping]: 782 """Returns a dictionary of room mappings by segment id.""" 783 return { 784 room.id: mapping 785 for room in self.rooms or () 786 if room.id is not None and (mapping := room.named_room_mapping) is not None 787 }
Returns a dictionary of room mappings by segment id.
Inherited Members
790@dataclass 791class MultiMapsList(RoborockBase): 792 max_multi_map: int | None = None 793 max_bak_map: int | None = None 794 multi_map_count: int | None = None 795 map_info: list[MultiMapsListMapInfo] | None = None
Inherited Members
798@dataclass 799class SmartWashParams(RoborockBase): 800 smart_wash: int | None = None 801 wash_interval: int | None = None
Inherited Members
804@dataclass 805class DustCollectionMode(RoborockBase): 806 mode: RoborockDockDustCollectionModeCode | None = None
Inherited Members
Inherited Members
814@dataclass 815class NetworkInfo(RoborockBase): 816 ip: str 817 ssid: str | None = None 818 mac: str | None = None 819 bssid: str | None = None 820 rssi: int | None = None
Inherited Members
823@dataclass 824class AppInitStatusLocalInfo(RoborockBase): 825 location: str 826 bom: str | None = None 827 featureset: int | None = None 828 language: str | None = None 829 logserver: str | None = None 830 wifiplan: str | None = None 831 timezone: str | None = None 832 name: str | None = None
Inherited Members
835@dataclass 836class AppInitStatus(RoborockBase): 837 local_info: AppInitStatusLocalInfo 838 feature_info: list[int] 839 new_feature_info: int = 0 840 new_feature_info_str: str = "" 841 new_feature_info_2: int | None = None 842 carriage_type: int | None = None 843 dsp_version: str | None = None