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