roborock.data.b01_q10.b01_q10_code_mappings
1from enum import IntEnum 2 3from ..code_mappings import RoborockModeEnum 4 5 6class B01_Q10_DP(RoborockModeEnum): 7 CLEAN_TIME = ("dpCleanTime", 6) 8 CLEAN_AREA = ("dpCleanArea", 7) 9 SEEK = ("dpSeek", 11) 10 REMOTE = ("dpRemote", 12) 11 MAP_RESET = ("dpMapReset", 13) 12 REQUEST = ("dpRequest", 16) 13 RESET_SIDE_BRUSH = ("dpResetSideBrush", 18) 14 RESET_MAIN_BRUSH = ("dpResetMainBrush", 20) 15 RESET_FILTER = ("dpResetFilter", 22) 16 RAG_LIFE = ("dpRagLife", 23) 17 RESET_RAG_LIFE = ("dpResetRagLife", 24) 18 NOT_DISTURB = ("dpNotDisturb", 25) 19 VOLUME = ("dpVolume", 26) 20 BEAK_CLEAN = ("dpBeakClean", 27) 21 TOTAL_CLEAN_AREA = ("dpTotalCleanArea", 29) 22 TOTAL_CLEAN_COUNT = ("dpTotalCleanCount", 30) 23 TOTAL_CLEAN_TIME = ("dpTotalCleanTime", 31) 24 TIMER = ("dpTimer", 32) 25 NOT_DISTURB_DATA = ("dpNotDisturbData", 33) 26 DEVICE_INFO = ("dpDeviceInfo", 34) 27 VOICE_PACKAGE = ("dpVoicePackage", 35) 28 VOICE_LANGUAGE = ("dpVoiceLanguage", 36) 29 DUST_SWITCH = ("dpDustSwitch", 37) 30 CUSTOM_MODE = ("dpCustomMode", 39) 31 MOP_STATE = ("dpMopState", 40) 32 UNIT = ("dpUnit", 42) 33 CARPET_CLEAN_PREFER = ("dpCarpetCleanPrefer", 44) 34 AUTO_BOOST = ("dpAutoBoost", 45) 35 CHILD_LOCK = ("dpChildLock", 47) 36 DUST_SETTING = ("dpDustSetting", 50) 37 MAP_SAVE_SWITCH = ("dpMapSaveSwitch", 51) 38 CLEAN_RECORD = ("dpCleanRecord", 52) 39 RECENT_CLEAN_RECORD = ("dpRecentCleanRecord", 53) # NOTE: typo "dpRecendCleanRecord" in source code 40 RESTRICTED_ZONE = ("dpRestrictedZone", 54) 41 RESTRICTED_ZONE_UP = ("dpRestrictedZoneUp", 55) 42 VIRTUAL_WALL = ("dpVirtualWall", 56) 43 VIRTUAL_WALL_UP = ("dpVirtualWallUp", 57) 44 ZONED = ("dpZoned", 58) 45 ZONED_UP = ("dpZonedUp", 59) 46 MULTI_MAP_SWITCH = ("dpMultiMapSwitch", 60) 47 MULTI_MAP = ("dpMultiMap", 61) 48 CUSTOMER_CLEAN = ("dpCustomerClean", 62) 49 CUSTOMER_CLEAN_REQUEST = ("dpCustomerCleanRequest", 63) 50 GET_CARPET = ("dpGetCarpet", 64) 51 CARPET_UP = ("dpCarpetUp", 65) 52 SELF_IDENTIFYING_CARPET = ("dpSelfIdentifyingCarpet", 66) 53 SENSOR_LIFE = ("dpSensorLife", 67) 54 RESET_SENSOR = ("dpResetSensor", 68) 55 REQUEST_TIMER = ("dpRequestTimer", 69) 56 REMOVE_ZONED = ("dpRemoveZoned", 70) 57 REMOVE_ZONED_UP = ("dpRemoveZonedUp", 71) 58 ROOM_MERGE = ("dpRoomMerge", 72) 59 ROOM_SPLIT = ("dpRoomSplit", 73) 60 RESET_ROOM_NAME = ("dpResetRoomName", 74) 61 REQUEST_NOT_DISTURB_DATA = ("dpRequestNotDisturbData", 75) # NOTE: typo "dpRequsetNotDisturbData" in source code 62 CARPET_CLEAN_TYPE = ("dpCarpetCleanType", 76) 63 BUTTON_LIGHT_SWITCH = ("dpButtonLightSwitch", 77) 64 CLEAN_LINE = ("dpCleanLine", 78) 65 TIME_ZONE = ("dpTimeZone", 79) 66 AREA_UNIT = ("dpAreaUnit", 80) 67 NET_INFO = ("dpNetInfo", 81) 68 CLEAN_ORDER = ("dpCleanOrder", 82) 69 ROBOT_TYPE = ("dpRobotType", 83) 70 LOG_SWITCH = ("dpLogSwitch", 84) 71 FLOOR_MATERIAL = ("dpFloorMaterial", 85) 72 LINE_LASER_OBSTACLE_AVOIDANCE = ("dpLineLaserObstacleAvoidance", 86) 73 CLEAN_PROGRESS = ("dpCleanProgress", 87) # NOTE: typo "dpCleanProgess" in source code 74 GROUND_CLEAN = ("dpGroundClean", 88) 75 IGNORE_OBSTACLE = ("dpIgnoreObstacle", 89) 76 FAULT = ("dpFault", 90) 77 CLEAN_EXPAND = ("dpCleanExpand", 91) 78 NOT_DISTURB_EXPAND = ("dpNotDisturbExpand", 92) 79 TIMER_TYPE = ("dpTimerType", 93) 80 CREATE_MAP_FINISHED = ("dpCreateMapFinished", 94) 81 ADD_CLEAN_AREA = ("dpAddCleanArea", 95) 82 ADD_CLEAN_STATE = ("dpAddCleanState", 96) 83 RESTRICTED_AREA = ("dpRestrictedArea", 97) 84 RESTRICTED_AREA_UP = ("dpRestrictedAreaUp", 98) 85 SUSPECTED_THRESHOLD = ("dpSuspectedThreshold", 99) 86 SUSPECTED_THRESHOLD_UP = ("dpSuspectedThresholdUp", 100) 87 COMMON = ("dpCommon", 101) 88 REQUEST_DPS = ("dpRequestDps", 102) # NOTE: typo "dpRequetdps" in source code 89 # NOTE: the legacy B01 source also listed dpJumpScan (101) and 90 # dpCliffRestrictedArea (102), which collided with the confirmed dpCommon / 91 # dpRequestDps codes above (verified against ss07 hardware and the official app 92 # plugin) and shadowed them in ``from_code``. Both are unused and their real 93 # codes could not be verified, so they were removed rather than left as wrong 94 # duplicates. dpCliffRestrictedAreaUp (103) is kept: ss07 hardware does push 95 # data point 103 (an empty list when no cliff-restricted areas are set). 96 CLIFF_RESTRICTED_AREA_UP = ("dpCliffRestrictedAreaUp", 103) 97 BREAKPOINT_CLEAN = ("dpBreakpointClean", 104) 98 VALLEY_POINT_CHARGING = ("dpValleyPointCharging", 105) 99 VALLEY_POINT_CHARGING_DATA_UP = ("dpValleyPointChargingDataUp", 106) 100 VALLEY_POINT_CHARGING_DATA = ("dpValleyPointChargingData", 107) 101 VOICE_VERSION = ("dpVoiceVersion", 108) 102 ROBOT_COUNTRY_CODE = ("dpRobotCountryCode", 109) 103 HEARTBEAT = ("dpHeartbeat", 110) 104 # NOTE: ss07 hardware also pushes data points 112 and 113 in its full status 105 # dump. They are absent from the official app's vacuum plugin and stayed 0 106 # across every observed state (docked/charging, segment cleaning, lifted-off- 107 # ground fault, returning to dock, dustbin removed), so their meaning is not 108 # yet known. They are intentionally left unmapped; ``decode_rpc_response`` 109 # silently ignores unknown codes via ``from_code_optional``, so they do not 110 # produce "not a valid code" warnings. Map them here once identified. 111 STATUS = ("dpStatus", 121) 112 BATTERY = ("dpBattery", 122) 113 FAN_LEVEL = ("dpFanLevel", 123) # NOTE: typo "dpfunLevel" in source code 114 WATER_LEVEL = ("dpWaterLevel", 124) 115 MAIN_BRUSH_LIFE = ("dpMainBrushLife", 125) 116 SIDE_BRUSH_LIFE = ("dpSideBrushLife", 126) 117 FILTER_LIFE = ("dpFilterLife", 127) 118 TASK_CANCEL_IN_MOTION = ("dpTaskCancelInMotion", 132) 119 OFFLINE = ("dpOffline", 135) 120 CLEAN_COUNT = ("dpCleanCount", 136) 121 CLEAN_MODE = ("dpCleanMode", 137) 122 CLEAN_TASK_TYPE = ("dpCleanTaskType", 138) 123 BACK_TYPE = ("dpBackType", 139) 124 CLEANING_PROGRESS = ("dpCleaningProgress", 141) 125 FLEEING_GOODS = ("dpFleeingGoods", 142) 126 START_CLEAN = ("dpStartClean", 201) 127 START_BACK = ("dpStartBack", 202) 128 START_DOCK_TASK = ("dpStartDockTask", 203) 129 PAUSE = ("dpPause", 204) 130 RESUME = ("dpResume", 205) 131 STOP = ("dpStop", 206) 132 USER_PLAN = ("dpUserPlan", 207) 133 134 135class YXFanLevel(RoborockModeEnum): 136 """The fan or vacuum level of the robot. 137 138 Note: The names used here are the v1 names, though the values 139 have different aliases in the app bundles. 140 """ 141 142 UNKNOWN = "unknown", -1 143 OFF = "off", 0 # close 144 QUIET = "quiet", 1 145 BALANCED = "balanced", 2 # normal 146 TURBO = "turbo", 3 # strong 147 MAX = "max", 4 148 MAX_PLUS = "max_plus", 8 # super 149 150 151class YXWaterLevel(RoborockModeEnum): 152 UNKNOWN = "unknown", -1 153 OFF = "off", 0 # close 154 LOW = "low", 1 155 MEDIUM = "medium", 2 # middle 156 HIGH = "high", 3 157 158 159class YXCleanLine(RoborockModeEnum): 160 FAST = "fast", 0 161 DAILY = "daily", 1 162 FINE = "fine", 2 163 164 165class YXRoomMaterial(RoborockModeEnum): 166 HORIZONTAL_FLOOR_BOARD = "horizontalfloorboard", 0 167 VERTICAL_FLOOR_BOARD = "verticalfloorboard", 1 168 CERAMIC_TILE = "ceramictile", 2 169 OTHER = "other", 255 170 171 172class YXCleanType(RoborockModeEnum): 173 UNKNOWN = "unknown", -1 174 VAC_AND_MOP = "vac_and_mop", 1 # bothwork 175 VACUUM = "vacuum", 2 # onlysweep 176 MOP = "mop", 3 # onlymop 177 CUSTOMIZED = "customized", 4 # custom mode 178 179 180class YXDeviceState(RoborockModeEnum): 181 UNKNOWN = "unknown", -1 182 SLEEPING = "sleeping", 2 # sleepstate 183 IDLE = "idle", 3 # standbystate 184 CLEANING = "cleaning", 5 # cleaningstate 185 RETURNING_HOME = "returning_home", 6 # tochargestate 186 REMOTE_CONTROL_ACTIVE = "remote_control_active", 7 # remoteingstate 187 CHARGING = "charging", 8 # chargingstate 188 PAUSED = "paused", 10 # pausestate 189 ERROR = "error", 12 # faultstate 190 UPDATING = "updating", 14 # upgradestate 191 EMPTYING_THE_BIN = "emptying_the_bin", 22 # dusting 192 MAPPING = "mapping", 29 # creatingmapstate 193 SAVING_MAP = "saving_map", 99 # mapsavestate 194 RELOCATING = "relocating", 101 # relocationstate 195 SWEEPING = "sweeping", 102 # robotsweeping 196 MOPPING = "mopping", 103 # robotmoping 197 SWEEP_AND_MOP = "sweep_and_mop", 104 # robotsweepandmoping 198 TRANSITIONING = "transitioning", 105 # robottransitioning 199 WAITING_TO_CHARGE = "waiting_to_charge", 108 # robotwaitcharge 200 201 202class YXBackType(RoborockModeEnum): 203 UNKNOWN = "unknown", -1 204 IDLE = "idle", 0 205 BACK_DUSTING = "backdusting", 4 206 BACK_CHARGING = "backcharging", 5 207 208 209class YXDeviceWorkMode(RoborockModeEnum): 210 UNKNOWN = "unknown", -1 211 BOTH_WORK = "bothwork", 1 212 ONLY_SWEEP = "onlysweep", 2 213 ONLY_MOP = "onlymop", 3 214 CUSTOMIZED = "customized", 4 215 SAVE_WORRY = "saveworry", 5 216 SWEEP_MOP = "sweepmop", 6 217 218 219class YXDeviceCleanTask(RoborockModeEnum): 220 UNKNOWN = "unknown", -1 221 IDLE = "idle", 0 222 SMART = "smart", 1 223 ELECTORAL = "electoral", 2 224 DIVIDE_AREAS = "divideareas", 3 225 CREATING_MAP = "creatingmap", 4 226 PART = "part", 5 227 228 229class YXCleanScope(RoborockModeEnum): 230 """Clean scope/type as stored in a *clean record* (``dpCleanRecord``, field 7). 231 232 This is the same conceptual axis as the live :class:`YXDeviceCleanTask`, but the 233 persisted record uses a different integer encoding -- e.g. a full clean records 234 ``0`` here vs ``1`` (``smart``) live, and a select-rooms clean records ``1`` here 235 vs ``2`` (``electoral``) live. Ground-truthed against the app's History labels; 236 code ``2`` was never observed on ss07 and is intentionally unmapped (so it 237 resolves to ``None`` rather than a guessed label). 238 """ 239 240 UNKNOWN = "unknown", -1 241 FULL = "full", 0 242 SELECTIVE_ROOM = "selective_room", 1 243 ZONE = "zone", 3 244 SPOT = "spot", 4 245 246 247class YXCleaningResult(RoborockModeEnum): 248 """How a clean ended, as stored in a clean record (``dpCleanRecord``, field 9).""" 249 250 UNKNOWN = "unknown", -1 251 INTERRUPTED = "interrupted", 0 # ended on a fault 252 COMPLETED = "completed", 1 253 STOPPED = "stopped", 2 # ended early without a fault 254 255 256class YXStartMethod(RoborockModeEnum): 257 """What initiated a clean, as stored in a clean record (``dpCleanRecord``, field 10).""" 258 259 UNKNOWN = "unknown", -1 260 REMOTE = "remote", 0 261 APP = "app", 1 262 TIMER = "timer", 2 # schedule / timer 263 BUTTON = "button", 3 # device button 264 265 266class YXDeviceDustCollectionFrequency(RoborockModeEnum): 267 # The app exposes "regular" (code 0) vs "frequent", where "frequent" selects 268 # one of the every-N-cleans intervals below. 269 REGULAR = "regular", 0 270 INTERVAL_15 = "interval_15", 15 271 INTERVAL_30 = "interval_30", 30 272 INTERVAL_45 = "interval_45", 45 273 INTERVAL_60 = "interval_60", 60 274 275 276class YXAreaUnit(RoborockModeEnum): 277 """Unit used to report cleaned area (dpAreaUnit).""" 278 279 SQUARE_METER = "square_meter", 0 280 SQUARE_FEET = "square_feet", 1 281 282 283class YXCarpetCleanType(RoborockModeEnum): 284 """Carpet handling behavior (dpCarpetCleanType).""" 285 286 RISE = "rise", 0 # lift the mop and boost over carpet 287 AVOID = "avoid", 1 288 IGNORE = "ignore", 2 289 CROSS = "cross", 3 290 291 292class YXFault(RoborockModeEnum): 293 """Q10 (B01/ss07) ``dpFault`` (90) codes, from the ss07 fault spec. 294 295 ``dpFault`` is *overloaded*: several values are lifecycle/status rather than 296 errors (e.g. 400 = scheduled clean starting, 501 = returning to dock, 297 502 = recharge). A non-zero fault is not necessarily a blocking error. 298 The converse also holds: the device can sit in its error state (``dpStatus`` 299 12) with ``dpFault`` still 0 (observed live with the dust-bin module 300 removed), so a ``None``/``NONE`` fault does not imply the absence of an 301 error condition. 302 303 These labels differ from the Q7 ``B01Fault`` for several shared numbers 304 (500, 501, 503, 569, 570) -- so this is a Q10-specific map, not a reuse of 305 ``B01Fault``. Codes marked "hw-confirmed" were observed firing live on a 306 physical ss07 in a context matching the label; the rest are from the spec 307 only, not yet observed live (single device). 308 """ 309 310 UNKNOWN = "unknown", -1 311 NONE = "none", 0 312 LIDAR_BLOCKED = "lidar_blocked", 1 313 BUMPER_STUCK = "bumper_stuck", 2 # hw-confirmed (bumper held in during commanded motion) 314 ROBOT_SUSPENDED = "robot_suspended", 3 # hw-confirmed (wheels lifted off the floor mid-task) 315 CLIFF_SENSOR_ERROR = "cliff_sensor_error", 4 # hw-confirmed (one side lifted mid-task) 316 MAIN_BRUSH_STUCK = "main_brush_stuck", 5 # hw-confirmed (two physical brush jams) 317 MAIN_WHEELS_STUCK = "main_wheels_stuck", 7 318 ROBOT_TRAPPED = "robot_trapped", 8 # hw-confirmed 319 CHECK_DUSTBIN_FILTER = "check_dustbin_filter", 9 320 LOW_BATTERY = "low_battery", 12 # hw-confirmed (fired at 14% mid clean) 321 TEMPERATURE_THRESHOLD = "temperature_threshold", 14 322 ROBOT_TILTED = "robot_tilted", 16 323 LIDAR_COVER_OBSTRUCTED = "lidar_cover_obstructed", 21 324 NO_GO_ZONE_DETECTED = "no_go_zone_detected", 24 325 MOPPING_MODULE_STUCK = "mopping_module_stuck", 27 326 CARPET_AVOIDANCE = "carpet_avoidance", 28 327 CANNOT_CROSS_CARPET = "cannot_cross_carpet", 29 328 INSTALL_DUST_BAG = "install_dust_bag", 46 # hw-confirmed (docked with bag removed; fires at dock contact) 329 MOP_MOUNT_FELL_OFF = "mop_mount_fell_off", 54 330 LIDAR_DIRTY = "lidar_dirty", 58 331 FILTER_SERVICE_LIFE = "filter_service_life", 301 332 MAIN_BRUSH_SERVICE_LIFE = "main_brush_service_life", 302 333 SIDE_BRUSH_SERVICE_LIFE = "side_brush_service_life", 303 334 SENSOR_NEEDS_CLEANING = "sensor_needs_cleaning", 304 # hw-confirmed (fired during auto-empty) 335 DUST_BAG_FULL = "dust_bag_full", 310 # inferred from auto-empty context; not hw-confirmed 336 STARTING_SCHEDULED_CLEAN = "starting_scheduled_clean", 400 # hw-confirmed x3; lifecycle, not an error 337 # hw-confirmed (a due scheduled clean fired mid-clean and was ignored); lifecycle, not an error 338 CLEANING_IN_PROGRESS = "cleaning_in_progress", 407 339 EMPTY_DUSTBIN = "empty_dustbin", 500 # ss07 != Q7 B01Fault (lidar_blocked); spec-only 340 # hw-confirmed, fires per completed task; ss07 != Q7 (robot_suspended) 341 CLEANING_COMPLETED_RETURNING = "cleaning_completed_returning", 501 342 LOW_BATTERY_RESUME = "low_battery_resume", 502 # hw-confirmed; lifecycle 343 DOCKING_ERROR = "docking_error", 503 # hw-confirmed; ss07 != Q7 (dustbin_not_installed) 344 POSITIONING_FAILED = "positioning_failed", 556 # hw-confirmed; relocalization 345 # hw-confirmed (3rd auto-empty in ~15 min: dock refuses to run the cycle); ss07 != Q7 (main_wheels_entangled) 346 TOO_FREQUENT_EMPTYING = "too_frequent_emptying", 569 347 CANNOT_REACH_TARGET = "cannot_reach_target", 570 # hw-confirmed; ss07 != Q7 (main_brush_entangled) 348 OFFLINE_WARNING_ASLEEP = "offline_warning_asleep", 588 349 OFFLINE_WARNING_LOW_BATTERY = "offline_warning_low_battery", 589 350 DND_AUTO_TOPUP_DISABLED = "dnd_auto_topup_disabled", 591 351 CLEAN_CARPET_ULTRASONIC_SENSORS = "clean_carpet_ultrasonic_sensors", 707 352 ROBOT_ERROR_RESET = "robot_error_reset", 1002 353 VOICE_PACK_UPDATE_AVAILABLE = "voice_pack_update_available", 3001 354 355 356class RemoteCommand(IntEnum): 357 FORWARD = 0 358 LEFT = 2 359 RIGHT = 3 360 STOP = 4 361 EXIT = 5
7class B01_Q10_DP(RoborockModeEnum): 8 CLEAN_TIME = ("dpCleanTime", 6) 9 CLEAN_AREA = ("dpCleanArea", 7) 10 SEEK = ("dpSeek", 11) 11 REMOTE = ("dpRemote", 12) 12 MAP_RESET = ("dpMapReset", 13) 13 REQUEST = ("dpRequest", 16) 14 RESET_SIDE_BRUSH = ("dpResetSideBrush", 18) 15 RESET_MAIN_BRUSH = ("dpResetMainBrush", 20) 16 RESET_FILTER = ("dpResetFilter", 22) 17 RAG_LIFE = ("dpRagLife", 23) 18 RESET_RAG_LIFE = ("dpResetRagLife", 24) 19 NOT_DISTURB = ("dpNotDisturb", 25) 20 VOLUME = ("dpVolume", 26) 21 BEAK_CLEAN = ("dpBeakClean", 27) 22 TOTAL_CLEAN_AREA = ("dpTotalCleanArea", 29) 23 TOTAL_CLEAN_COUNT = ("dpTotalCleanCount", 30) 24 TOTAL_CLEAN_TIME = ("dpTotalCleanTime", 31) 25 TIMER = ("dpTimer", 32) 26 NOT_DISTURB_DATA = ("dpNotDisturbData", 33) 27 DEVICE_INFO = ("dpDeviceInfo", 34) 28 VOICE_PACKAGE = ("dpVoicePackage", 35) 29 VOICE_LANGUAGE = ("dpVoiceLanguage", 36) 30 DUST_SWITCH = ("dpDustSwitch", 37) 31 CUSTOM_MODE = ("dpCustomMode", 39) 32 MOP_STATE = ("dpMopState", 40) 33 UNIT = ("dpUnit", 42) 34 CARPET_CLEAN_PREFER = ("dpCarpetCleanPrefer", 44) 35 AUTO_BOOST = ("dpAutoBoost", 45) 36 CHILD_LOCK = ("dpChildLock", 47) 37 DUST_SETTING = ("dpDustSetting", 50) 38 MAP_SAVE_SWITCH = ("dpMapSaveSwitch", 51) 39 CLEAN_RECORD = ("dpCleanRecord", 52) 40 RECENT_CLEAN_RECORD = ("dpRecentCleanRecord", 53) # NOTE: typo "dpRecendCleanRecord" in source code 41 RESTRICTED_ZONE = ("dpRestrictedZone", 54) 42 RESTRICTED_ZONE_UP = ("dpRestrictedZoneUp", 55) 43 VIRTUAL_WALL = ("dpVirtualWall", 56) 44 VIRTUAL_WALL_UP = ("dpVirtualWallUp", 57) 45 ZONED = ("dpZoned", 58) 46 ZONED_UP = ("dpZonedUp", 59) 47 MULTI_MAP_SWITCH = ("dpMultiMapSwitch", 60) 48 MULTI_MAP = ("dpMultiMap", 61) 49 CUSTOMER_CLEAN = ("dpCustomerClean", 62) 50 CUSTOMER_CLEAN_REQUEST = ("dpCustomerCleanRequest", 63) 51 GET_CARPET = ("dpGetCarpet", 64) 52 CARPET_UP = ("dpCarpetUp", 65) 53 SELF_IDENTIFYING_CARPET = ("dpSelfIdentifyingCarpet", 66) 54 SENSOR_LIFE = ("dpSensorLife", 67) 55 RESET_SENSOR = ("dpResetSensor", 68) 56 REQUEST_TIMER = ("dpRequestTimer", 69) 57 REMOVE_ZONED = ("dpRemoveZoned", 70) 58 REMOVE_ZONED_UP = ("dpRemoveZonedUp", 71) 59 ROOM_MERGE = ("dpRoomMerge", 72) 60 ROOM_SPLIT = ("dpRoomSplit", 73) 61 RESET_ROOM_NAME = ("dpResetRoomName", 74) 62 REQUEST_NOT_DISTURB_DATA = ("dpRequestNotDisturbData", 75) # NOTE: typo "dpRequsetNotDisturbData" in source code 63 CARPET_CLEAN_TYPE = ("dpCarpetCleanType", 76) 64 BUTTON_LIGHT_SWITCH = ("dpButtonLightSwitch", 77) 65 CLEAN_LINE = ("dpCleanLine", 78) 66 TIME_ZONE = ("dpTimeZone", 79) 67 AREA_UNIT = ("dpAreaUnit", 80) 68 NET_INFO = ("dpNetInfo", 81) 69 CLEAN_ORDER = ("dpCleanOrder", 82) 70 ROBOT_TYPE = ("dpRobotType", 83) 71 LOG_SWITCH = ("dpLogSwitch", 84) 72 FLOOR_MATERIAL = ("dpFloorMaterial", 85) 73 LINE_LASER_OBSTACLE_AVOIDANCE = ("dpLineLaserObstacleAvoidance", 86) 74 CLEAN_PROGRESS = ("dpCleanProgress", 87) # NOTE: typo "dpCleanProgess" in source code 75 GROUND_CLEAN = ("dpGroundClean", 88) 76 IGNORE_OBSTACLE = ("dpIgnoreObstacle", 89) 77 FAULT = ("dpFault", 90) 78 CLEAN_EXPAND = ("dpCleanExpand", 91) 79 NOT_DISTURB_EXPAND = ("dpNotDisturbExpand", 92) 80 TIMER_TYPE = ("dpTimerType", 93) 81 CREATE_MAP_FINISHED = ("dpCreateMapFinished", 94) 82 ADD_CLEAN_AREA = ("dpAddCleanArea", 95) 83 ADD_CLEAN_STATE = ("dpAddCleanState", 96) 84 RESTRICTED_AREA = ("dpRestrictedArea", 97) 85 RESTRICTED_AREA_UP = ("dpRestrictedAreaUp", 98) 86 SUSPECTED_THRESHOLD = ("dpSuspectedThreshold", 99) 87 SUSPECTED_THRESHOLD_UP = ("dpSuspectedThresholdUp", 100) 88 COMMON = ("dpCommon", 101) 89 REQUEST_DPS = ("dpRequestDps", 102) # NOTE: typo "dpRequetdps" in source code 90 # NOTE: the legacy B01 source also listed dpJumpScan (101) and 91 # dpCliffRestrictedArea (102), which collided with the confirmed dpCommon / 92 # dpRequestDps codes above (verified against ss07 hardware and the official app 93 # plugin) and shadowed them in ``from_code``. Both are unused and their real 94 # codes could not be verified, so they were removed rather than left as wrong 95 # duplicates. dpCliffRestrictedAreaUp (103) is kept: ss07 hardware does push 96 # data point 103 (an empty list when no cliff-restricted areas are set). 97 CLIFF_RESTRICTED_AREA_UP = ("dpCliffRestrictedAreaUp", 103) 98 BREAKPOINT_CLEAN = ("dpBreakpointClean", 104) 99 VALLEY_POINT_CHARGING = ("dpValleyPointCharging", 105) 100 VALLEY_POINT_CHARGING_DATA_UP = ("dpValleyPointChargingDataUp", 106) 101 VALLEY_POINT_CHARGING_DATA = ("dpValleyPointChargingData", 107) 102 VOICE_VERSION = ("dpVoiceVersion", 108) 103 ROBOT_COUNTRY_CODE = ("dpRobotCountryCode", 109) 104 HEARTBEAT = ("dpHeartbeat", 110) 105 # NOTE: ss07 hardware also pushes data points 112 and 113 in its full status 106 # dump. They are absent from the official app's vacuum plugin and stayed 0 107 # across every observed state (docked/charging, segment cleaning, lifted-off- 108 # ground fault, returning to dock, dustbin removed), so their meaning is not 109 # yet known. They are intentionally left unmapped; ``decode_rpc_response`` 110 # silently ignores unknown codes via ``from_code_optional``, so they do not 111 # produce "not a valid code" warnings. Map them here once identified. 112 STATUS = ("dpStatus", 121) 113 BATTERY = ("dpBattery", 122) 114 FAN_LEVEL = ("dpFanLevel", 123) # NOTE: typo "dpfunLevel" in source code 115 WATER_LEVEL = ("dpWaterLevel", 124) 116 MAIN_BRUSH_LIFE = ("dpMainBrushLife", 125) 117 SIDE_BRUSH_LIFE = ("dpSideBrushLife", 126) 118 FILTER_LIFE = ("dpFilterLife", 127) 119 TASK_CANCEL_IN_MOTION = ("dpTaskCancelInMotion", 132) 120 OFFLINE = ("dpOffline", 135) 121 CLEAN_COUNT = ("dpCleanCount", 136) 122 CLEAN_MODE = ("dpCleanMode", 137) 123 CLEAN_TASK_TYPE = ("dpCleanTaskType", 138) 124 BACK_TYPE = ("dpBackType", 139) 125 CLEANING_PROGRESS = ("dpCleaningProgress", 141) 126 FLEEING_GOODS = ("dpFleeingGoods", 142) 127 START_CLEAN = ("dpStartClean", 201) 128 START_BACK = ("dpStartBack", 202) 129 START_DOCK_TASK = ("dpStartDockTask", 203) 130 PAUSE = ("dpPause", 204) 131 RESUME = ("dpResume", 205) 132 STOP = ("dpStop", 206) 133 USER_PLAN = ("dpUserPlan", 207)
A custom StrEnum that also stores an integer code for each member.
136class YXFanLevel(RoborockModeEnum): 137 """The fan or vacuum level of the robot. 138 139 Note: The names used here are the v1 names, though the values 140 have different aliases in the app bundles. 141 """ 142 143 UNKNOWN = "unknown", -1 144 OFF = "off", 0 # close 145 QUIET = "quiet", 1 146 BALANCED = "balanced", 2 # normal 147 TURBO = "turbo", 3 # strong 148 MAX = "max", 4 149 MAX_PLUS = "max_plus", 8 # super
The fan or vacuum level of the robot.
Note: The names used here are the v1 names, though the values have different aliases in the app bundles.
152class YXWaterLevel(RoborockModeEnum): 153 UNKNOWN = "unknown", -1 154 OFF = "off", 0 # close 155 LOW = "low", 1 156 MEDIUM = "medium", 2 # middle 157 HIGH = "high", 3
A custom StrEnum that also stores an integer code for each member.
160class YXCleanLine(RoborockModeEnum): 161 FAST = "fast", 0 162 DAILY = "daily", 1 163 FINE = "fine", 2
A custom StrEnum that also stores an integer code for each member.
166class YXRoomMaterial(RoborockModeEnum): 167 HORIZONTAL_FLOOR_BOARD = "horizontalfloorboard", 0 168 VERTICAL_FLOOR_BOARD = "verticalfloorboard", 1 169 CERAMIC_TILE = "ceramictile", 2 170 OTHER = "other", 255
A custom StrEnum that also stores an integer code for each member.
173class YXCleanType(RoborockModeEnum): 174 UNKNOWN = "unknown", -1 175 VAC_AND_MOP = "vac_and_mop", 1 # bothwork 176 VACUUM = "vacuum", 2 # onlysweep 177 MOP = "mop", 3 # onlymop 178 CUSTOMIZED = "customized", 4 # custom mode
A custom StrEnum that also stores an integer code for each member.
181class YXDeviceState(RoborockModeEnum): 182 UNKNOWN = "unknown", -1 183 SLEEPING = "sleeping", 2 # sleepstate 184 IDLE = "idle", 3 # standbystate 185 CLEANING = "cleaning", 5 # cleaningstate 186 RETURNING_HOME = "returning_home", 6 # tochargestate 187 REMOTE_CONTROL_ACTIVE = "remote_control_active", 7 # remoteingstate 188 CHARGING = "charging", 8 # chargingstate 189 PAUSED = "paused", 10 # pausestate 190 ERROR = "error", 12 # faultstate 191 UPDATING = "updating", 14 # upgradestate 192 EMPTYING_THE_BIN = "emptying_the_bin", 22 # dusting 193 MAPPING = "mapping", 29 # creatingmapstate 194 SAVING_MAP = "saving_map", 99 # mapsavestate 195 RELOCATING = "relocating", 101 # relocationstate 196 SWEEPING = "sweeping", 102 # robotsweeping 197 MOPPING = "mopping", 103 # robotmoping 198 SWEEP_AND_MOP = "sweep_and_mop", 104 # robotsweepandmoping 199 TRANSITIONING = "transitioning", 105 # robottransitioning 200 WAITING_TO_CHARGE = "waiting_to_charge", 108 # robotwaitcharge
A custom StrEnum that also stores an integer code for each member.
203class YXBackType(RoborockModeEnum): 204 UNKNOWN = "unknown", -1 205 IDLE = "idle", 0 206 BACK_DUSTING = "backdusting", 4 207 BACK_CHARGING = "backcharging", 5
A custom StrEnum that also stores an integer code for each member.
210class YXDeviceWorkMode(RoborockModeEnum): 211 UNKNOWN = "unknown", -1 212 BOTH_WORK = "bothwork", 1 213 ONLY_SWEEP = "onlysweep", 2 214 ONLY_MOP = "onlymop", 3 215 CUSTOMIZED = "customized", 4 216 SAVE_WORRY = "saveworry", 5 217 SWEEP_MOP = "sweepmop", 6
A custom StrEnum that also stores an integer code for each member.
220class YXDeviceCleanTask(RoborockModeEnum): 221 UNKNOWN = "unknown", -1 222 IDLE = "idle", 0 223 SMART = "smart", 1 224 ELECTORAL = "electoral", 2 225 DIVIDE_AREAS = "divideareas", 3 226 CREATING_MAP = "creatingmap", 4 227 PART = "part", 5
A custom StrEnum that also stores an integer code for each member.
230class YXCleanScope(RoborockModeEnum): 231 """Clean scope/type as stored in a *clean record* (``dpCleanRecord``, field 7). 232 233 This is the same conceptual axis as the live :class:`YXDeviceCleanTask`, but the 234 persisted record uses a different integer encoding -- e.g. a full clean records 235 ``0`` here vs ``1`` (``smart``) live, and a select-rooms clean records ``1`` here 236 vs ``2`` (``electoral``) live. Ground-truthed against the app's History labels; 237 code ``2`` was never observed on ss07 and is intentionally unmapped (so it 238 resolves to ``None`` rather than a guessed label). 239 """ 240 241 UNKNOWN = "unknown", -1 242 FULL = "full", 0 243 SELECTIVE_ROOM = "selective_room", 1 244 ZONE = "zone", 3 245 SPOT = "spot", 4
Clean scope/type as stored in a clean record (dpCleanRecord, field 7).
This is the same conceptual axis as the live YXDeviceCleanTask, but the
persisted record uses a different integer encoding -- e.g. a full clean records
0 here vs 1 (smart) live, and a select-rooms clean records 1 here
vs 2 (electoral) live. Ground-truthed against the app's History labels;
code 2 was never observed on ss07 and is intentionally unmapped (so it
resolves to None rather than a guessed label).
248class YXCleaningResult(RoborockModeEnum): 249 """How a clean ended, as stored in a clean record (``dpCleanRecord``, field 9).""" 250 251 UNKNOWN = "unknown", -1 252 INTERRUPTED = "interrupted", 0 # ended on a fault 253 COMPLETED = "completed", 1 254 STOPPED = "stopped", 2 # ended early without a fault
How a clean ended, as stored in a clean record (dpCleanRecord, field 9).
257class YXStartMethod(RoborockModeEnum): 258 """What initiated a clean, as stored in a clean record (``dpCleanRecord``, field 10).""" 259 260 UNKNOWN = "unknown", -1 261 REMOTE = "remote", 0 262 APP = "app", 1 263 TIMER = "timer", 2 # schedule / timer 264 BUTTON = "button", 3 # device button
What initiated a clean, as stored in a clean record (dpCleanRecord, field 10).
267class YXDeviceDustCollectionFrequency(RoborockModeEnum): 268 # The app exposes "regular" (code 0) vs "frequent", where "frequent" selects 269 # one of the every-N-cleans intervals below. 270 REGULAR = "regular", 0 271 INTERVAL_15 = "interval_15", 15 272 INTERVAL_30 = "interval_30", 30 273 INTERVAL_45 = "interval_45", 45 274 INTERVAL_60 = "interval_60", 60
A custom StrEnum that also stores an integer code for each member.
277class YXAreaUnit(RoborockModeEnum): 278 """Unit used to report cleaned area (dpAreaUnit).""" 279 280 SQUARE_METER = "square_meter", 0 281 SQUARE_FEET = "square_feet", 1
Unit used to report cleaned area (dpAreaUnit).
284class YXCarpetCleanType(RoborockModeEnum): 285 """Carpet handling behavior (dpCarpetCleanType).""" 286 287 RISE = "rise", 0 # lift the mop and boost over carpet 288 AVOID = "avoid", 1 289 IGNORE = "ignore", 2 290 CROSS = "cross", 3
Carpet handling behavior (dpCarpetCleanType).
293class YXFault(RoborockModeEnum): 294 """Q10 (B01/ss07) ``dpFault`` (90) codes, from the ss07 fault spec. 295 296 ``dpFault`` is *overloaded*: several values are lifecycle/status rather than 297 errors (e.g. 400 = scheduled clean starting, 501 = returning to dock, 298 502 = recharge). A non-zero fault is not necessarily a blocking error. 299 The converse also holds: the device can sit in its error state (``dpStatus`` 300 12) with ``dpFault`` still 0 (observed live with the dust-bin module 301 removed), so a ``None``/``NONE`` fault does not imply the absence of an 302 error condition. 303 304 These labels differ from the Q7 ``B01Fault`` for several shared numbers 305 (500, 501, 503, 569, 570) -- so this is a Q10-specific map, not a reuse of 306 ``B01Fault``. Codes marked "hw-confirmed" were observed firing live on a 307 physical ss07 in a context matching the label; the rest are from the spec 308 only, not yet observed live (single device). 309 """ 310 311 UNKNOWN = "unknown", -1 312 NONE = "none", 0 313 LIDAR_BLOCKED = "lidar_blocked", 1 314 BUMPER_STUCK = "bumper_stuck", 2 # hw-confirmed (bumper held in during commanded motion) 315 ROBOT_SUSPENDED = "robot_suspended", 3 # hw-confirmed (wheels lifted off the floor mid-task) 316 CLIFF_SENSOR_ERROR = "cliff_sensor_error", 4 # hw-confirmed (one side lifted mid-task) 317 MAIN_BRUSH_STUCK = "main_brush_stuck", 5 # hw-confirmed (two physical brush jams) 318 MAIN_WHEELS_STUCK = "main_wheels_stuck", 7 319 ROBOT_TRAPPED = "robot_trapped", 8 # hw-confirmed 320 CHECK_DUSTBIN_FILTER = "check_dustbin_filter", 9 321 LOW_BATTERY = "low_battery", 12 # hw-confirmed (fired at 14% mid clean) 322 TEMPERATURE_THRESHOLD = "temperature_threshold", 14 323 ROBOT_TILTED = "robot_tilted", 16 324 LIDAR_COVER_OBSTRUCTED = "lidar_cover_obstructed", 21 325 NO_GO_ZONE_DETECTED = "no_go_zone_detected", 24 326 MOPPING_MODULE_STUCK = "mopping_module_stuck", 27 327 CARPET_AVOIDANCE = "carpet_avoidance", 28 328 CANNOT_CROSS_CARPET = "cannot_cross_carpet", 29 329 INSTALL_DUST_BAG = "install_dust_bag", 46 # hw-confirmed (docked with bag removed; fires at dock contact) 330 MOP_MOUNT_FELL_OFF = "mop_mount_fell_off", 54 331 LIDAR_DIRTY = "lidar_dirty", 58 332 FILTER_SERVICE_LIFE = "filter_service_life", 301 333 MAIN_BRUSH_SERVICE_LIFE = "main_brush_service_life", 302 334 SIDE_BRUSH_SERVICE_LIFE = "side_brush_service_life", 303 335 SENSOR_NEEDS_CLEANING = "sensor_needs_cleaning", 304 # hw-confirmed (fired during auto-empty) 336 DUST_BAG_FULL = "dust_bag_full", 310 # inferred from auto-empty context; not hw-confirmed 337 STARTING_SCHEDULED_CLEAN = "starting_scheduled_clean", 400 # hw-confirmed x3; lifecycle, not an error 338 # hw-confirmed (a due scheduled clean fired mid-clean and was ignored); lifecycle, not an error 339 CLEANING_IN_PROGRESS = "cleaning_in_progress", 407 340 EMPTY_DUSTBIN = "empty_dustbin", 500 # ss07 != Q7 B01Fault (lidar_blocked); spec-only 341 # hw-confirmed, fires per completed task; ss07 != Q7 (robot_suspended) 342 CLEANING_COMPLETED_RETURNING = "cleaning_completed_returning", 501 343 LOW_BATTERY_RESUME = "low_battery_resume", 502 # hw-confirmed; lifecycle 344 DOCKING_ERROR = "docking_error", 503 # hw-confirmed; ss07 != Q7 (dustbin_not_installed) 345 POSITIONING_FAILED = "positioning_failed", 556 # hw-confirmed; relocalization 346 # hw-confirmed (3rd auto-empty in ~15 min: dock refuses to run the cycle); ss07 != Q7 (main_wheels_entangled) 347 TOO_FREQUENT_EMPTYING = "too_frequent_emptying", 569 348 CANNOT_REACH_TARGET = "cannot_reach_target", 570 # hw-confirmed; ss07 != Q7 (main_brush_entangled) 349 OFFLINE_WARNING_ASLEEP = "offline_warning_asleep", 588 350 OFFLINE_WARNING_LOW_BATTERY = "offline_warning_low_battery", 589 351 DND_AUTO_TOPUP_DISABLED = "dnd_auto_topup_disabled", 591 352 CLEAN_CARPET_ULTRASONIC_SENSORS = "clean_carpet_ultrasonic_sensors", 707 353 ROBOT_ERROR_RESET = "robot_error_reset", 1002 354 VOICE_PACK_UPDATE_AVAILABLE = "voice_pack_update_available", 3001
Q10 (B01/ss07) dpFault (90) codes, from the ss07 fault spec.
dpFault is overloaded: several values are lifecycle/status rather than
errors (e.g. 400 = scheduled clean starting, 501 = returning to dock,
502 = recharge). A non-zero fault is not necessarily a blocking error.
The converse also holds: the device can sit in its error state (dpStatus
12) with dpFault still 0 (observed live with the dust-bin module
removed), so a None/NONE fault does not imply the absence of an
error condition.
These labels differ from the Q7 B01Fault for several shared numbers
(500, 501, 503, 569, 570) -- so this is a Q10-specific map, not a reuse of
B01Fault. Codes marked "hw-confirmed" were observed firing live on a
physical ss07 in a context matching the label; the rest are from the spec
only, not yet observed live (single device).
357class RemoteCommand(IntEnum): 358 FORWARD = 0 359 LEFT = 2 360 RIGHT = 3 361 STOP = 4 362 EXIT = 5