roborock.data.b01_q7.b01_q7_code_mappings

  1from typing import Self, cast
  2
  3from ..code_mappings import RoborockEnum, RoborockModeEnum
  4
  5
  6class WorkStatusMapping(RoborockModeEnum):
  7    """Maps the general status of the robot."""
  8
  9    SLEEPING = ("sleeping", 0)
 10    WAITING_FOR_ORDERS = ("waiting_for_orders", 1)
 11    PAUSED = ("paused", 2)
 12    DOCKING = ("docking", 3)
 13    CHARGING = ("charging", 4)
 14    SWEEP_MOPING = ("sweep_moping", 5)
 15    SWEEP_MOPING_2 = ("sweep_moping_2", 6)
 16    MOPING = ("moping", 7)
 17    UPDATING = ("updating", 8)
 18    MOP_CLEANING = ("mop_cleaning", 9)
 19    MOP_AIRDRYING = ("mop_airdrying", 10)
 20    WORKING_SLEEP = ("working_sleep", 11)
 21    UNKNOWN = ("unknown", -1)
 22
 23    @classmethod
 24    def from_code(cls, code: int) -> Self:
 25        """Map unrecognized Q7 statuses to UNKNOWN without failing the response."""
 26        try:
 27            return super().from_code(code)
 28        except ValueError:
 29            return cast(Self, cls.UNKNOWN)
 30
 31
 32class SCWindMapping(RoborockModeEnum):
 33    """Maps suction power levels."""
 34
 35    SILENCE = ("quiet", 1)
 36    STANDARD = ("balanced", 2)
 37    STRONG = ("turbo", 3)
 38    SUPER_STRONG = ("max", 4)
 39    SUPER_STRONG_PLUS = ("max_plus", 5)
 40
 41
 42class WaterLevelMapping(RoborockModeEnum):
 43    """Maps water flow levels."""
 44
 45    LOW = ("low", 1)
 46    MEDIUM = ("medium", 2)
 47    HIGH = ("high", 3)
 48
 49
 50class CleanTypeMapping(RoborockModeEnum):
 51    """Maps the type of cleaning (Vacuum, Mop, or both)."""
 52
 53    VACUUM = ("vacuum", 0)
 54    VAC_AND_MOP = ("vac_and_mop", 1)
 55    MOP = ("mop", 2)
 56
 57
 58class CleanRepeatMapping(RoborockModeEnum):
 59    """Maps the cleaning repeat parameter."""
 60
 61    ONE = ("one", 0)
 62    TWO = ("two", 1)
 63
 64
 65class CleanPathPreferenceMapping(RoborockModeEnum):
 66    """Maps the cleaning path preference parameter."""
 67
 68    BALANCED = ("balanced", 0)
 69    DEEP = ("deep", 1)
 70
 71
 72class SCDeviceCleanParam(RoborockModeEnum):
 73    """Maps the control values for cleaning tasks."""
 74
 75    STOP = ("stop", 0)
 76    START = ("start", 1)
 77    PAUSE = ("pause", 2)
 78
 79
 80class WorkModeMapping(RoborockModeEnum):
 81    """Maps the detailed work modes of the robot."""
 82
 83    IDLE = ("idle", 0)
 84    AUTO = ("auto", 1)
 85    MANUAL = ("manual", 2)
 86    AREA = ("area", 3)
 87    AUTO_PAUSE = ("auto_pause", 4)
 88    BACK_CHARGE = ("back_charge", 5)
 89    POINT = ("point", 6)
 90    NAVI = ("navi", 7)
 91    AREA_PAUSE = ("area_pause", 8)
 92    NAVI_PAUSE = ("navi_pause", 9)
 93    GLOBAL_GO_HOME = ("global_go_home", 10)
 94    GLOBAL_BROKEN = ("global_broken", 11)
 95    NAVI_GO_HOME = ("navi_go_home", 12)
 96    POINT_GO_HOME = ("point_go_home", 13)
 97    NAVI_IDLE = ("navi_idle", 14)
 98    SCREW = ("screw", 20)
 99    SCREW_GO_HOME = ("screw_go_home", 21)
100    POINT_IDLE = ("point_idle", 22)
101    SCREW_IDLE = ("screw_idle", 23)
102    BORDER = ("border", 25)
103    BORDER_GO_HOME = ("border_go_home", 26)
104    BORDER_PAUSE = ("border_pause", 27)
105    BORDER_BROKEN = ("border_broken", 28)
106    BORDER_IDLE = ("border_idle", 29)
107    PLAN_AREA = ("plan_area", 30)
108    PLAN_AREA_PAUSE = ("plan_area_pause", 31)
109    PLAN_AREA_GO_HOME = ("plan_area_go_home", 32)
110    PLAN_AREA_BROKEN = ("plan_area_broken", 33)
111    PLAN_AREA_IDLE = ("plan_area_idle", 35)
112    MOPPING = ("mopping", 36)
113    MOPPING_PAUSE = ("mopping_pause", 37)
114    MOPPING_GO_HOME = ("mopping_go_home", 38)
115    MOPPING_BROKEN = ("mopping_broken", 39)
116    MOPPING_IDLE = ("mopping_idle", 40)
117    EXPLORING = ("exploring", 45)
118    EXPLORE_PAUSE = ("explore_pause", 46)
119    EXPLORE_GO_HOME = ("explore_go_home", 47)
120    EXPLORE_BROKEN = ("explore_broken", 48)
121    EXPLORE_IDLE = ("explore_idle", 49)
122
123
124class StationStateMapping(RoborockEnum):
125    """Known dock activity states observed on the Q7 M5+."""
126
127    unknown = -1
128    idle = 0
129    collecting_dust = 3
130
131
132class DustCollectionStateMapping(RoborockEnum):
133    """Known dust collection states observed on the Q7 M5+."""
134
135    unknown = -1
136    idle = 0
137    collecting_dust = 1
138
139
140class StationActionMapping(RoborockModeEnum):
141    """Maps actions for the cleaning/drying station."""
142
143    STOP_CLEAN_OR_AIRDRY = ("stop_clean_or_airdry", 0)
144    MOP_CLEAN = ("mop_clean", 1)
145    MOP_AIRDRY = ("mop_airdry", 2)
146
147
148class CleanTaskTypeMapping(RoborockModeEnum):
149    """Maps the high-level type of cleaning task selected."""
150
151    ALL = ("full", 0)
152    ROOM = ("room", 1)
153    AREA = ("zones", 4)
154    ROOM_NORMAL = ("room_normal", 5)
155    CUSTOM_MODE = ("customize", 6)
156    ALL_CUSTOM = ("all_custom", 11)
157    AREA_CUSTOM = ("area_custom", 99)
158
159
160class CarpetModeMapping(RoborockModeEnum):
161    """Maps carpet handling parameters."""
162
163    FOLLOW_GLOBAL = ("follow_global", 0)
164    ON = ("on", 1)
165    OFF = ("off", 2)
166
167
168class B01Fault(RoborockModeEnum):
169    """B01 fault codes and their descriptions."""
170
171    F_0 = ("fault_0", 0)
172    F_407 = ("cleaning_in_progress", 407)  # Cleaning in progress. Scheduled cleanup ignored.
173    F_500 = (
174        "lidar_blocked",
175        500,
176    )  # LiDAR turret or laser blocked. Check for obstruction and retry. LiDAR sensor obstructed or stuck.
177    # Remove foreign objects if any. If the problem persists, move the robot away and restart.
178    F_501 = (
179        "robot_suspended",
180        501,
181    )  # Robot suspended. Move the robot away and restart. Cliff sensors dirty. Wipe them clean.
182    F_502 = (
183        "low_battery",
184        502,
185    )  # Low battery. Recharge now. Battery low. Put the robot on the dock to charge it to 20% before starting.
186    F_503 = (
187        "dustbin_not_installed",
188        503,
189    )  # Check that the dustbin and filter are installed properly. Reinstall the dustbin and filter in place.
190    # If the problem persists, replace the filter.
191    F_504 = ("fault_504", 504)
192    F_505 = ("fault_505", 505)
193    F_506 = ("fault_506", 506)
194    F_507 = ("fault_507", 507)
195    F_508 = ("fault_508", 508)
196    F_509 = ("cliff_sensor_error", 509)  # Cliff sensors error. Clean them, move the robot away from drops, and restart.
197    F_510 = (
198        "bumper_stuck",
199        510,
200    )  # Bumper stuck. Clean it and lightly tap to release it. Tap it repeatedly to release it. If no foreign object
201    # exists, move the robot away and restart.
202    F_511 = (
203        "docking_error",
204        511,
205    )  # Docking error. Put the robot on the dock. Clear obstacles around the dock, clean charging contacts, and put
206    # the robot on the dock.
207    F_512 = (
208        "docking_error",
209        512,
210    )  # Docking error. Put the robot on the dock. Clear obstacles around the dock, clean charging contacts, and put
211    # the robot on the dock.
212    F_513 = (
213        "robot_trapped",
214        513,
215    )  # Robot trapped. Move the robot away and restart. Clear obstacles around robot or move robot away and restart.
216    F_514 = (
217        "robot_trapped",
218        514,
219    )  # Robot trapped. Move the robot away and restart. Clear obstacles around robot or move robot away and restart.
220    F_515 = ("fault_515", 515)
221    F_517 = ("fault_517", 517)
222    F_518 = (
223        "low_battery",
224        518,
225    )  # Low battery. Recharge now. Battery low. Put the robot on the dock to charge it to 20% before starting.
226    F_519 = ("fault_519", 519)
227    F_520 = ("fault_520", 520)
228    F_521 = ("fault_521", 521)
229    F_522 = ("mop_not_installed", 522)  # Check that the mop is properly installed. Mop not installed. Reinstall it.
230    F_523 = ("fault_523", 523)
231    F_525 = ("fault_525", 525)
232    F_526 = ("fault_526", 526)
233    F_527 = ("fault_527", 527)
234    F_528 = ("fault_528", 528)
235    F_529 = ("fault_529", 529)
236    F_530 = ("fault_530", 530)
237    F_531 = ("fault_531", 531)
238    F_532 = ("fault_532", 532)
239    F_533 = ("long_sleep", 533)  # About to shut down after a long time of sleep. Charge the robot.
240    F_534 = (
241        "low_battery_shutdown",
242        534,
243    )  # Low battery. Turning off. About to shut down due to low battery. Charge the robot.
244    F_535 = ("fault_535", 535)
245    F_536 = ("fault_536", 536)
246    F_540 = ("fault_540", 540)
247    F_541 = ("fault_541", 541)
248    F_542 = ("fault_542", 542)
249    F_550 = ("fault_550", 550)
250    F_551 = ("fault_551", 551)
251    F_559 = ("fault_559", 559)
252    F_560 = ("side_brush_entangled", 560)  # Side brush entangled. Remove and clean it.
253    F_561 = ("fault_561", 561)
254    F_562 = ("fault_562", 562)
255    F_563 = ("fault_563", 563)
256    F_564 = ("fault_564", 564)
257    F_565 = ("fault_565", 565)
258    F_566 = ("fault_566", 566)
259    F_567 = ("fault_567", 567)
260    F_568 = ("main_wheels_entangled", 568)  # Clean main wheels, move the robot away and restart.
261    F_569 = ("main_wheels_entangled", 569)  # Clean main wheels, move the robot away and restart.
262    F_570 = ("main_brush_entangled", 570)  # Main brush entangled. Remove and clean it and its bearing.
263    F_571 = ("fault_571", 571)
264    F_572 = ("main_brush_entangled", 572)  # Main brush entangled. Remove and clean it and its bearing.
265    F_573 = ("fault_573", 573)
266    F_574 = ("fault_574", 574)
267    F_580 = ("fault_580", 580)
268    F_581 = ("fault_581", 581)
269    F_582 = ("fault_582", 582)
270    F_583 = ("fault_583", 583)
271    F_584 = ("fault_584", 584)
272    F_585 = ("fault_585", 585)
273    F_586 = ("fault_586", 586)
274    F_587 = ("fault_587", 587)
275    F_588 = ("fault_588", 588)
276    F_589 = ("fault_589", 589)
277    F_590 = ("fault_590", 590)
278    F_591 = ("fault_591", 591)
279    F_592 = ("fault_592", 592)
280    F_593 = ("fault_593", 593)
281    F_594 = (
282        "dust_bag_not_installed",
283        594,
284    )  # Make sure the dust bag is properly installed. Dust bag not installed. Check that it is installed properly.
285    F_601 = ("fault_601", 601)
286    F_602 = ("fault_602", 602)
287    F_603 = ("fault_603", 603)
288    F_604 = ("fault_604", 604)
289    F_605 = ("fault_605", 605)
290    F_611 = ("positioning_failed", 611)  # Positioning failed. Move the robot back to the dock and remap.
291    F_612 = (
292        "map_changed",
293        612,
294    )  # Map changed. Positioning failed. Try again. New environment detected. Map changed. Positioning failed.
295    # Try again after remapping.
296    F_629 = ("mop_mount_fell_off", 629)  # Mop cloth mount fell off. Reinstall it to resume working.
297    F_668 = (
298        "system_error",
299        668,
300    )  # Robot error. Reset the system. Fan error. Reset the system. If the problem persists, contact customer service.
301    F_2000 = ("fault_2000", 2000)
302    F_2003 = ("low_battery_schedule_canceled", 2003)  # Battery level below 20%. Scheduled task canceled.
303    F_2007 = (
304        "cannot_reach_target",
305        2007,
306    )  # Unable to reach the target. Cleaning ended. Ensure the door to the target area is open or unobstructed.
307    F_2012 = (
308        "cannot_reach_target",
309        2012,
310    )  # Unable to reach the target. Cleaning ended. Ensure the door to the target area is open or unobstructed.
311    F_2013 = ("fault_2013", 2013)
312    F_2015 = ("fault_2015", 2015)
313    F_2017 = ("fault_2017", 2017)
314    F_2100 = (
315        "low_battery_resume_later",
316        2100,
317    )  # Low battery. Resume cleaning after recharging. Low battery. Starting to recharge. Resume cleaning after
318    # charging.
319    F_2101 = ("fault_2101", 2101)
320    F_2102 = ("cleaning_complete", 2102)  # Cleaning completed. Returning to the dock.
321    F_2103 = (
322        "cleaning_complete_docked",
323        2103,
324    )  # Task finished and robot docked. Follows 2102 once docking and any auto-empty complete; persists
325    # while docked-idle. Not an error (hw-confirmed on a Q7 M5+).
326    F_2104 = ("fault_2104", 2104)
327    F_2105 = ("fault_2105", 2105)
328    F_2108 = ("fault_2108", 2108)
329    F_2109 = ("fault_2109", 2109)
330    F_2110 = ("fault_2110", 2110)
331    F_2111 = ("fault_2111", 2111)
332    F_2112 = ("fault_2112", 2112)
333    F_2113 = ("fault_2113", 2113)
334    F_2114 = ("fault_2114", 2114)
335    F_2115 = ("fault_2115", 2115)
class WorkStatusMapping(roborock.data.code_mappings.RoborockModeEnum):
 7class WorkStatusMapping(RoborockModeEnum):
 8    """Maps the general status of the robot."""
 9
10    SLEEPING = ("sleeping", 0)
11    WAITING_FOR_ORDERS = ("waiting_for_orders", 1)
12    PAUSED = ("paused", 2)
13    DOCKING = ("docking", 3)
14    CHARGING = ("charging", 4)
15    SWEEP_MOPING = ("sweep_moping", 5)
16    SWEEP_MOPING_2 = ("sweep_moping_2", 6)
17    MOPING = ("moping", 7)
18    UPDATING = ("updating", 8)
19    MOP_CLEANING = ("mop_cleaning", 9)
20    MOP_AIRDRYING = ("mop_airdrying", 10)
21    WORKING_SLEEP = ("working_sleep", 11)
22    UNKNOWN = ("unknown", -1)
23
24    @classmethod
25    def from_code(cls, code: int) -> Self:
26        """Map unrecognized Q7 statuses to UNKNOWN without failing the response."""
27        try:
28            return super().from_code(code)
29        except ValueError:
30            return cast(Self, cls.UNKNOWN)

Maps the general status of the robot.

SLEEPING = <WorkStatusMapping.SLEEPING: 'sleeping'>
WAITING_FOR_ORDERS = <WorkStatusMapping.WAITING_FOR_ORDERS: 'waiting_for_orders'>
PAUSED = <WorkStatusMapping.PAUSED: 'paused'>
DOCKING = <WorkStatusMapping.DOCKING: 'docking'>
CHARGING = <WorkStatusMapping.CHARGING: 'charging'>
SWEEP_MOPING = <WorkStatusMapping.SWEEP_MOPING: 'sweep_moping'>
SWEEP_MOPING_2 = <WorkStatusMapping.SWEEP_MOPING_2: 'sweep_moping_2'>
MOPING = <WorkStatusMapping.MOPING: 'moping'>
UPDATING = <WorkStatusMapping.UPDATING: 'updating'>
MOP_CLEANING = <WorkStatusMapping.MOP_CLEANING: 'mop_cleaning'>
MOP_AIRDRYING = <WorkStatusMapping.MOP_AIRDRYING: 'mop_airdrying'>
WORKING_SLEEP = <WorkStatusMapping.WORKING_SLEEP: 'working_sleep'>
UNKNOWN = <WorkStatusMapping.UNKNOWN: 'unknown'>
@classmethod
def from_code(cls, code: int) -> Self:
24    @classmethod
25    def from_code(cls, code: int) -> Self:
26        """Map unrecognized Q7 statuses to UNKNOWN without failing the response."""
27        try:
28            return super().from_code(code)
29        except ValueError:
30            return cast(Self, cls.UNKNOWN)

Map unrecognized Q7 statuses to UNKNOWN without failing the response.

class SCWindMapping(roborock.data.code_mappings.RoborockModeEnum):
33class SCWindMapping(RoborockModeEnum):
34    """Maps suction power levels."""
35
36    SILENCE = ("quiet", 1)
37    STANDARD = ("balanced", 2)
38    STRONG = ("turbo", 3)
39    SUPER_STRONG = ("max", 4)
40    SUPER_STRONG_PLUS = ("max_plus", 5)

Maps suction power levels.

SILENCE = <SCWindMapping.SILENCE: 'quiet'>
STANDARD = <SCWindMapping.STANDARD: 'balanced'>
STRONG = <SCWindMapping.STRONG: 'turbo'>
SUPER_STRONG = <SCWindMapping.SUPER_STRONG: 'max'>
SUPER_STRONG_PLUS = <SCWindMapping.SUPER_STRONG_PLUS: 'max_plus'>
class WaterLevelMapping(roborock.data.code_mappings.RoborockModeEnum):
43class WaterLevelMapping(RoborockModeEnum):
44    """Maps water flow levels."""
45
46    LOW = ("low", 1)
47    MEDIUM = ("medium", 2)
48    HIGH = ("high", 3)

Maps water flow levels.

LOW = <WaterLevelMapping.LOW: 'low'>
MEDIUM = <WaterLevelMapping.MEDIUM: 'medium'>
HIGH = <WaterLevelMapping.HIGH: 'high'>
class CleanTypeMapping(roborock.data.code_mappings.RoborockModeEnum):
51class CleanTypeMapping(RoborockModeEnum):
52    """Maps the type of cleaning (Vacuum, Mop, or both)."""
53
54    VACUUM = ("vacuum", 0)
55    VAC_AND_MOP = ("vac_and_mop", 1)
56    MOP = ("mop", 2)

Maps the type of cleaning (Vacuum, Mop, or both).

VACUUM = <CleanTypeMapping.VACUUM: 'vacuum'>
VAC_AND_MOP = <CleanTypeMapping.VAC_AND_MOP: 'vac_and_mop'>
MOP = <CleanTypeMapping.MOP: 'mop'>
class CleanRepeatMapping(roborock.data.code_mappings.RoborockModeEnum):
59class CleanRepeatMapping(RoborockModeEnum):
60    """Maps the cleaning repeat parameter."""
61
62    ONE = ("one", 0)
63    TWO = ("two", 1)

Maps the cleaning repeat parameter.

ONE = <CleanRepeatMapping.ONE: 'one'>
TWO = <CleanRepeatMapping.TWO: 'two'>
class CleanPathPreferenceMapping(roborock.data.code_mappings.RoborockModeEnum):
66class CleanPathPreferenceMapping(RoborockModeEnum):
67    """Maps the cleaning path preference parameter."""
68
69    BALANCED = ("balanced", 0)
70    DEEP = ("deep", 1)

Maps the cleaning path preference parameter.

BALANCED = <CleanPathPreferenceMapping.BALANCED: 'balanced'>
class SCDeviceCleanParam(roborock.data.code_mappings.RoborockModeEnum):
73class SCDeviceCleanParam(RoborockModeEnum):
74    """Maps the control values for cleaning tasks."""
75
76    STOP = ("stop", 0)
77    START = ("start", 1)
78    PAUSE = ("pause", 2)

Maps the control values for cleaning tasks.

STOP = <SCDeviceCleanParam.STOP: 'stop'>
START = <SCDeviceCleanParam.START: 'start'>
PAUSE = <SCDeviceCleanParam.PAUSE: 'pause'>
class WorkModeMapping(roborock.data.code_mappings.RoborockModeEnum):
 81class WorkModeMapping(RoborockModeEnum):
 82    """Maps the detailed work modes of the robot."""
 83
 84    IDLE = ("idle", 0)
 85    AUTO = ("auto", 1)
 86    MANUAL = ("manual", 2)
 87    AREA = ("area", 3)
 88    AUTO_PAUSE = ("auto_pause", 4)
 89    BACK_CHARGE = ("back_charge", 5)
 90    POINT = ("point", 6)
 91    NAVI = ("navi", 7)
 92    AREA_PAUSE = ("area_pause", 8)
 93    NAVI_PAUSE = ("navi_pause", 9)
 94    GLOBAL_GO_HOME = ("global_go_home", 10)
 95    GLOBAL_BROKEN = ("global_broken", 11)
 96    NAVI_GO_HOME = ("navi_go_home", 12)
 97    POINT_GO_HOME = ("point_go_home", 13)
 98    NAVI_IDLE = ("navi_idle", 14)
 99    SCREW = ("screw", 20)
100    SCREW_GO_HOME = ("screw_go_home", 21)
101    POINT_IDLE = ("point_idle", 22)
102    SCREW_IDLE = ("screw_idle", 23)
103    BORDER = ("border", 25)
104    BORDER_GO_HOME = ("border_go_home", 26)
105    BORDER_PAUSE = ("border_pause", 27)
106    BORDER_BROKEN = ("border_broken", 28)
107    BORDER_IDLE = ("border_idle", 29)
108    PLAN_AREA = ("plan_area", 30)
109    PLAN_AREA_PAUSE = ("plan_area_pause", 31)
110    PLAN_AREA_GO_HOME = ("plan_area_go_home", 32)
111    PLAN_AREA_BROKEN = ("plan_area_broken", 33)
112    PLAN_AREA_IDLE = ("plan_area_idle", 35)
113    MOPPING = ("mopping", 36)
114    MOPPING_PAUSE = ("mopping_pause", 37)
115    MOPPING_GO_HOME = ("mopping_go_home", 38)
116    MOPPING_BROKEN = ("mopping_broken", 39)
117    MOPPING_IDLE = ("mopping_idle", 40)
118    EXPLORING = ("exploring", 45)
119    EXPLORE_PAUSE = ("explore_pause", 46)
120    EXPLORE_GO_HOME = ("explore_go_home", 47)
121    EXPLORE_BROKEN = ("explore_broken", 48)
122    EXPLORE_IDLE = ("explore_idle", 49)

Maps the detailed work modes of the robot.

IDLE = <WorkModeMapping.IDLE: 'idle'>
AUTO = <WorkModeMapping.AUTO: 'auto'>
MANUAL = <WorkModeMapping.MANUAL: 'manual'>
AREA = <WorkModeMapping.AREA: 'area'>
AUTO_PAUSE = <WorkModeMapping.AUTO_PAUSE: 'auto_pause'>
BACK_CHARGE = <WorkModeMapping.BACK_CHARGE: 'back_charge'>
POINT = <WorkModeMapping.POINT: 'point'>
NAVI = <WorkModeMapping.NAVI: 'navi'>
AREA_PAUSE = <WorkModeMapping.AREA_PAUSE: 'area_pause'>
NAVI_PAUSE = <WorkModeMapping.NAVI_PAUSE: 'navi_pause'>
GLOBAL_GO_HOME = <WorkModeMapping.GLOBAL_GO_HOME: 'global_go_home'>
GLOBAL_BROKEN = <WorkModeMapping.GLOBAL_BROKEN: 'global_broken'>
NAVI_GO_HOME = <WorkModeMapping.NAVI_GO_HOME: 'navi_go_home'>
POINT_GO_HOME = <WorkModeMapping.POINT_GO_HOME: 'point_go_home'>
NAVI_IDLE = <WorkModeMapping.NAVI_IDLE: 'navi_idle'>
SCREW = <WorkModeMapping.SCREW: 'screw'>
SCREW_GO_HOME = <WorkModeMapping.SCREW_GO_HOME: 'screw_go_home'>
POINT_IDLE = <WorkModeMapping.POINT_IDLE: 'point_idle'>
SCREW_IDLE = <WorkModeMapping.SCREW_IDLE: 'screw_idle'>
BORDER = <WorkModeMapping.BORDER: 'border'>
BORDER_GO_HOME = <WorkModeMapping.BORDER_GO_HOME: 'border_go_home'>
BORDER_PAUSE = <WorkModeMapping.BORDER_PAUSE: 'border_pause'>
BORDER_BROKEN = <WorkModeMapping.BORDER_BROKEN: 'border_broken'>
BORDER_IDLE = <WorkModeMapping.BORDER_IDLE: 'border_idle'>
PLAN_AREA = <WorkModeMapping.PLAN_AREA: 'plan_area'>
PLAN_AREA_PAUSE = <WorkModeMapping.PLAN_AREA_PAUSE: 'plan_area_pause'>
PLAN_AREA_GO_HOME = <WorkModeMapping.PLAN_AREA_GO_HOME: 'plan_area_go_home'>
PLAN_AREA_BROKEN = <WorkModeMapping.PLAN_AREA_BROKEN: 'plan_area_broken'>
PLAN_AREA_IDLE = <WorkModeMapping.PLAN_AREA_IDLE: 'plan_area_idle'>
MOPPING = <WorkModeMapping.MOPPING: 'mopping'>
MOPPING_PAUSE = <WorkModeMapping.MOPPING_PAUSE: 'mopping_pause'>
MOPPING_GO_HOME = <WorkModeMapping.MOPPING_GO_HOME: 'mopping_go_home'>
MOPPING_BROKEN = <WorkModeMapping.MOPPING_BROKEN: 'mopping_broken'>
MOPPING_IDLE = <WorkModeMapping.MOPPING_IDLE: 'mopping_idle'>
EXPLORING = <WorkModeMapping.EXPLORING: 'exploring'>
EXPLORE_PAUSE = <WorkModeMapping.EXPLORE_PAUSE: 'explore_pause'>
EXPLORE_GO_HOME = <WorkModeMapping.EXPLORE_GO_HOME: 'explore_go_home'>
EXPLORE_BROKEN = <WorkModeMapping.EXPLORE_BROKEN: 'explore_broken'>
EXPLORE_IDLE = <WorkModeMapping.EXPLORE_IDLE: 'explore_idle'>
class StationStateMapping(roborock.data.code_mappings.RoborockEnum):
125class StationStateMapping(RoborockEnum):
126    """Known dock activity states observed on the Q7 M5+."""
127
128    unknown = -1
129    idle = 0
130    collecting_dust = 3

Known dock activity states observed on the Q7 M5+.

unknown = <StationStateMapping.unknown: -1>
collecting_dust = <StationStateMapping.collecting_dust: 3>
class DustCollectionStateMapping(roborock.data.code_mappings.RoborockEnum):
133class DustCollectionStateMapping(RoborockEnum):
134    """Known dust collection states observed on the Q7 M5+."""
135
136    unknown = -1
137    idle = 0
138    collecting_dust = 1

Known dust collection states observed on the Q7 M5+.

class StationActionMapping(roborock.data.code_mappings.RoborockModeEnum):
141class StationActionMapping(RoborockModeEnum):
142    """Maps actions for the cleaning/drying station."""
143
144    STOP_CLEAN_OR_AIRDRY = ("stop_clean_or_airdry", 0)
145    MOP_CLEAN = ("mop_clean", 1)
146    MOP_AIRDRY = ("mop_airdry", 2)

Maps actions for the cleaning/drying station.

STOP_CLEAN_OR_AIRDRY = <StationActionMapping.STOP_CLEAN_OR_AIRDRY: 'stop_clean_or_airdry'>
MOP_CLEAN = <StationActionMapping.MOP_CLEAN: 'mop_clean'>
MOP_AIRDRY = <StationActionMapping.MOP_AIRDRY: 'mop_airdry'>
class CleanTaskTypeMapping(roborock.data.code_mappings.RoborockModeEnum):
149class CleanTaskTypeMapping(RoborockModeEnum):
150    """Maps the high-level type of cleaning task selected."""
151
152    ALL = ("full", 0)
153    ROOM = ("room", 1)
154    AREA = ("zones", 4)
155    ROOM_NORMAL = ("room_normal", 5)
156    CUSTOM_MODE = ("customize", 6)
157    ALL_CUSTOM = ("all_custom", 11)
158    AREA_CUSTOM = ("area_custom", 99)

Maps the high-level type of cleaning task selected.

ALL = <CleanTaskTypeMapping.ALL: 'full'>
ROOM = <CleanTaskTypeMapping.ROOM: 'room'>
AREA = <CleanTaskTypeMapping.AREA: 'zones'>
ROOM_NORMAL = <CleanTaskTypeMapping.ROOM_NORMAL: 'room_normal'>
CUSTOM_MODE = <CleanTaskTypeMapping.CUSTOM_MODE: 'customize'>
ALL_CUSTOM = <CleanTaskTypeMapping.ALL_CUSTOM: 'all_custom'>
AREA_CUSTOM = <CleanTaskTypeMapping.AREA_CUSTOM: 'area_custom'>
class CarpetModeMapping(roborock.data.code_mappings.RoborockModeEnum):
161class CarpetModeMapping(RoborockModeEnum):
162    """Maps carpet handling parameters."""
163
164    FOLLOW_GLOBAL = ("follow_global", 0)
165    ON = ("on", 1)
166    OFF = ("off", 2)

Maps carpet handling parameters.

FOLLOW_GLOBAL = <CarpetModeMapping.FOLLOW_GLOBAL: 'follow_global'>
ON = <CarpetModeMapping.ON: 'on'>
OFF = <CarpetModeMapping.OFF: 'off'>
class B01Fault(roborock.data.code_mappings.RoborockModeEnum):
169class B01Fault(RoborockModeEnum):
170    """B01 fault codes and their descriptions."""
171
172    F_0 = ("fault_0", 0)
173    F_407 = ("cleaning_in_progress", 407)  # Cleaning in progress. Scheduled cleanup ignored.
174    F_500 = (
175        "lidar_blocked",
176        500,
177    )  # LiDAR turret or laser blocked. Check for obstruction and retry. LiDAR sensor obstructed or stuck.
178    # Remove foreign objects if any. If the problem persists, move the robot away and restart.
179    F_501 = (
180        "robot_suspended",
181        501,
182    )  # Robot suspended. Move the robot away and restart. Cliff sensors dirty. Wipe them clean.
183    F_502 = (
184        "low_battery",
185        502,
186    )  # Low battery. Recharge now. Battery low. Put the robot on the dock to charge it to 20% before starting.
187    F_503 = (
188        "dustbin_not_installed",
189        503,
190    )  # Check that the dustbin and filter are installed properly. Reinstall the dustbin and filter in place.
191    # If the problem persists, replace the filter.
192    F_504 = ("fault_504", 504)
193    F_505 = ("fault_505", 505)
194    F_506 = ("fault_506", 506)
195    F_507 = ("fault_507", 507)
196    F_508 = ("fault_508", 508)
197    F_509 = ("cliff_sensor_error", 509)  # Cliff sensors error. Clean them, move the robot away from drops, and restart.
198    F_510 = (
199        "bumper_stuck",
200        510,
201    )  # Bumper stuck. Clean it and lightly tap to release it. Tap it repeatedly to release it. If no foreign object
202    # exists, move the robot away and restart.
203    F_511 = (
204        "docking_error",
205        511,
206    )  # Docking error. Put the robot on the dock. Clear obstacles around the dock, clean charging contacts, and put
207    # the robot on the dock.
208    F_512 = (
209        "docking_error",
210        512,
211    )  # Docking error. Put the robot on the dock. Clear obstacles around the dock, clean charging contacts, and put
212    # the robot on the dock.
213    F_513 = (
214        "robot_trapped",
215        513,
216    )  # Robot trapped. Move the robot away and restart. Clear obstacles around robot or move robot away and restart.
217    F_514 = (
218        "robot_trapped",
219        514,
220    )  # Robot trapped. Move the robot away and restart. Clear obstacles around robot or move robot away and restart.
221    F_515 = ("fault_515", 515)
222    F_517 = ("fault_517", 517)
223    F_518 = (
224        "low_battery",
225        518,
226    )  # Low battery. Recharge now. Battery low. Put the robot on the dock to charge it to 20% before starting.
227    F_519 = ("fault_519", 519)
228    F_520 = ("fault_520", 520)
229    F_521 = ("fault_521", 521)
230    F_522 = ("mop_not_installed", 522)  # Check that the mop is properly installed. Mop not installed. Reinstall it.
231    F_523 = ("fault_523", 523)
232    F_525 = ("fault_525", 525)
233    F_526 = ("fault_526", 526)
234    F_527 = ("fault_527", 527)
235    F_528 = ("fault_528", 528)
236    F_529 = ("fault_529", 529)
237    F_530 = ("fault_530", 530)
238    F_531 = ("fault_531", 531)
239    F_532 = ("fault_532", 532)
240    F_533 = ("long_sleep", 533)  # About to shut down after a long time of sleep. Charge the robot.
241    F_534 = (
242        "low_battery_shutdown",
243        534,
244    )  # Low battery. Turning off. About to shut down due to low battery. Charge the robot.
245    F_535 = ("fault_535", 535)
246    F_536 = ("fault_536", 536)
247    F_540 = ("fault_540", 540)
248    F_541 = ("fault_541", 541)
249    F_542 = ("fault_542", 542)
250    F_550 = ("fault_550", 550)
251    F_551 = ("fault_551", 551)
252    F_559 = ("fault_559", 559)
253    F_560 = ("side_brush_entangled", 560)  # Side brush entangled. Remove and clean it.
254    F_561 = ("fault_561", 561)
255    F_562 = ("fault_562", 562)
256    F_563 = ("fault_563", 563)
257    F_564 = ("fault_564", 564)
258    F_565 = ("fault_565", 565)
259    F_566 = ("fault_566", 566)
260    F_567 = ("fault_567", 567)
261    F_568 = ("main_wheels_entangled", 568)  # Clean main wheels, move the robot away and restart.
262    F_569 = ("main_wheels_entangled", 569)  # Clean main wheels, move the robot away and restart.
263    F_570 = ("main_brush_entangled", 570)  # Main brush entangled. Remove and clean it and its bearing.
264    F_571 = ("fault_571", 571)
265    F_572 = ("main_brush_entangled", 572)  # Main brush entangled. Remove and clean it and its bearing.
266    F_573 = ("fault_573", 573)
267    F_574 = ("fault_574", 574)
268    F_580 = ("fault_580", 580)
269    F_581 = ("fault_581", 581)
270    F_582 = ("fault_582", 582)
271    F_583 = ("fault_583", 583)
272    F_584 = ("fault_584", 584)
273    F_585 = ("fault_585", 585)
274    F_586 = ("fault_586", 586)
275    F_587 = ("fault_587", 587)
276    F_588 = ("fault_588", 588)
277    F_589 = ("fault_589", 589)
278    F_590 = ("fault_590", 590)
279    F_591 = ("fault_591", 591)
280    F_592 = ("fault_592", 592)
281    F_593 = ("fault_593", 593)
282    F_594 = (
283        "dust_bag_not_installed",
284        594,
285    )  # Make sure the dust bag is properly installed. Dust bag not installed. Check that it is installed properly.
286    F_601 = ("fault_601", 601)
287    F_602 = ("fault_602", 602)
288    F_603 = ("fault_603", 603)
289    F_604 = ("fault_604", 604)
290    F_605 = ("fault_605", 605)
291    F_611 = ("positioning_failed", 611)  # Positioning failed. Move the robot back to the dock and remap.
292    F_612 = (
293        "map_changed",
294        612,
295    )  # Map changed. Positioning failed. Try again. New environment detected. Map changed. Positioning failed.
296    # Try again after remapping.
297    F_629 = ("mop_mount_fell_off", 629)  # Mop cloth mount fell off. Reinstall it to resume working.
298    F_668 = (
299        "system_error",
300        668,
301    )  # Robot error. Reset the system. Fan error. Reset the system. If the problem persists, contact customer service.
302    F_2000 = ("fault_2000", 2000)
303    F_2003 = ("low_battery_schedule_canceled", 2003)  # Battery level below 20%. Scheduled task canceled.
304    F_2007 = (
305        "cannot_reach_target",
306        2007,
307    )  # Unable to reach the target. Cleaning ended. Ensure the door to the target area is open or unobstructed.
308    F_2012 = (
309        "cannot_reach_target",
310        2012,
311    )  # Unable to reach the target. Cleaning ended. Ensure the door to the target area is open or unobstructed.
312    F_2013 = ("fault_2013", 2013)
313    F_2015 = ("fault_2015", 2015)
314    F_2017 = ("fault_2017", 2017)
315    F_2100 = (
316        "low_battery_resume_later",
317        2100,
318    )  # Low battery. Resume cleaning after recharging. Low battery. Starting to recharge. Resume cleaning after
319    # charging.
320    F_2101 = ("fault_2101", 2101)
321    F_2102 = ("cleaning_complete", 2102)  # Cleaning completed. Returning to the dock.
322    F_2103 = (
323        "cleaning_complete_docked",
324        2103,
325    )  # Task finished and robot docked. Follows 2102 once docking and any auto-empty complete; persists
326    # while docked-idle. Not an error (hw-confirmed on a Q7 M5+).
327    F_2104 = ("fault_2104", 2104)
328    F_2105 = ("fault_2105", 2105)
329    F_2108 = ("fault_2108", 2108)
330    F_2109 = ("fault_2109", 2109)
331    F_2110 = ("fault_2110", 2110)
332    F_2111 = ("fault_2111", 2111)
333    F_2112 = ("fault_2112", 2112)
334    F_2113 = ("fault_2113", 2113)
335    F_2114 = ("fault_2114", 2114)
336    F_2115 = ("fault_2115", 2115)

B01 fault codes and their descriptions.

F_0 = <B01Fault.F_0: 'fault_0'>
F_407 = <B01Fault.F_407: 'cleaning_in_progress'>
F_500 = <B01Fault.F_500: 'lidar_blocked'>
F_501 = <B01Fault.F_501: 'robot_suspended'>
F_502 = <B01Fault.F_502: 'low_battery'>
F_503 = <B01Fault.F_503: 'dustbin_not_installed'>
F_504 = <B01Fault.F_504: 'fault_504'>
F_505 = <B01Fault.F_505: 'fault_505'>
F_506 = <B01Fault.F_506: 'fault_506'>
F_507 = <B01Fault.F_507: 'fault_507'>
F_508 = <B01Fault.F_508: 'fault_508'>
F_509 = <B01Fault.F_509: 'cliff_sensor_error'>
F_510 = <B01Fault.F_510: 'bumper_stuck'>
F_511 = <B01Fault.F_511: 'docking_error'>
F_512 = <B01Fault.F_511: 'docking_error'>
F_513 = <B01Fault.F_513: 'robot_trapped'>
F_514 = <B01Fault.F_513: 'robot_trapped'>
F_515 = <B01Fault.F_515: 'fault_515'>
F_517 = <B01Fault.F_517: 'fault_517'>
F_518 = <B01Fault.F_502: 'low_battery'>
F_519 = <B01Fault.F_519: 'fault_519'>
F_520 = <B01Fault.F_520: 'fault_520'>
F_521 = <B01Fault.F_521: 'fault_521'>
F_522 = <B01Fault.F_522: 'mop_not_installed'>
F_523 = <B01Fault.F_523: 'fault_523'>
F_525 = <B01Fault.F_525: 'fault_525'>
F_526 = <B01Fault.F_526: 'fault_526'>
F_527 = <B01Fault.F_527: 'fault_527'>
F_528 = <B01Fault.F_528: 'fault_528'>
F_529 = <B01Fault.F_529: 'fault_529'>
F_530 = <B01Fault.F_530: 'fault_530'>
F_531 = <B01Fault.F_531: 'fault_531'>
F_532 = <B01Fault.F_532: 'fault_532'>
F_533 = <B01Fault.F_533: 'long_sleep'>
F_534 = <B01Fault.F_534: 'low_battery_shutdown'>
F_535 = <B01Fault.F_535: 'fault_535'>
F_536 = <B01Fault.F_536: 'fault_536'>
F_540 = <B01Fault.F_540: 'fault_540'>
F_541 = <B01Fault.F_541: 'fault_541'>
F_542 = <B01Fault.F_542: 'fault_542'>
F_550 = <B01Fault.F_550: 'fault_550'>
F_551 = <B01Fault.F_551: 'fault_551'>
F_559 = <B01Fault.F_559: 'fault_559'>
F_560 = <B01Fault.F_560: 'side_brush_entangled'>
F_561 = <B01Fault.F_561: 'fault_561'>
F_562 = <B01Fault.F_562: 'fault_562'>
F_563 = <B01Fault.F_563: 'fault_563'>
F_564 = <B01Fault.F_564: 'fault_564'>
F_565 = <B01Fault.F_565: 'fault_565'>
F_566 = <B01Fault.F_566: 'fault_566'>
F_567 = <B01Fault.F_567: 'fault_567'>
F_568 = <B01Fault.F_568: 'main_wheels_entangled'>
F_569 = <B01Fault.F_568: 'main_wheels_entangled'>
F_570 = <B01Fault.F_570: 'main_brush_entangled'>
F_571 = <B01Fault.F_571: 'fault_571'>
F_572 = <B01Fault.F_570: 'main_brush_entangled'>
F_573 = <B01Fault.F_573: 'fault_573'>
F_574 = <B01Fault.F_574: 'fault_574'>
F_580 = <B01Fault.F_580: 'fault_580'>
F_581 = <B01Fault.F_581: 'fault_581'>
F_582 = <B01Fault.F_582: 'fault_582'>
F_583 = <B01Fault.F_583: 'fault_583'>
F_584 = <B01Fault.F_584: 'fault_584'>
F_585 = <B01Fault.F_585: 'fault_585'>
F_586 = <B01Fault.F_586: 'fault_586'>
F_587 = <B01Fault.F_587: 'fault_587'>
F_588 = <B01Fault.F_588: 'fault_588'>
F_589 = <B01Fault.F_589: 'fault_589'>
F_590 = <B01Fault.F_590: 'fault_590'>
F_591 = <B01Fault.F_591: 'fault_591'>
F_592 = <B01Fault.F_592: 'fault_592'>
F_593 = <B01Fault.F_593: 'fault_593'>
F_594 = <B01Fault.F_594: 'dust_bag_not_installed'>
F_601 = <B01Fault.F_601: 'fault_601'>
F_602 = <B01Fault.F_602: 'fault_602'>
F_603 = <B01Fault.F_603: 'fault_603'>
F_604 = <B01Fault.F_604: 'fault_604'>
F_605 = <B01Fault.F_605: 'fault_605'>
F_611 = <B01Fault.F_611: 'positioning_failed'>
F_612 = <B01Fault.F_612: 'map_changed'>
F_629 = <B01Fault.F_629: 'mop_mount_fell_off'>
F_668 = <B01Fault.F_668: 'system_error'>
F_2000 = <B01Fault.F_2000: 'fault_2000'>
F_2003 = <B01Fault.F_2003: 'low_battery_schedule_canceled'>
F_2007 = <B01Fault.F_2007: 'cannot_reach_target'>
F_2012 = <B01Fault.F_2007: 'cannot_reach_target'>
F_2013 = <B01Fault.F_2013: 'fault_2013'>
F_2015 = <B01Fault.F_2015: 'fault_2015'>
F_2017 = <B01Fault.F_2017: 'fault_2017'>
F_2100 = <B01Fault.F_2100: 'low_battery_resume_later'>
F_2101 = <B01Fault.F_2101: 'fault_2101'>
F_2102 = <B01Fault.F_2102: 'cleaning_complete'>
F_2103 = <B01Fault.F_2103: 'cleaning_complete_docked'>
F_2104 = <B01Fault.F_2104: 'fault_2104'>
F_2105 = <B01Fault.F_2105: 'fault_2105'>
F_2108 = <B01Fault.F_2108: 'fault_2108'>
F_2109 = <B01Fault.F_2109: 'fault_2109'>
F_2110 = <B01Fault.F_2110: 'fault_2110'>
F_2111 = <B01Fault.F_2111: 'fault_2111'>
F_2112 = <B01Fault.F_2112: 'fault_2112'>
F_2113 = <B01Fault.F_2113: 'fault_2113'>
F_2114 = <B01Fault.F_2114: 'fault_2114'>
F_2115 = <B01Fault.F_2115: 'fault_2115'>