Skip to content

Commit

Permalink
feat: add s8_maxv_ultra info (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lash-L authored May 8, 2024
1 parent 2702f50 commit aaaf0f0
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/source/api_commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Api commands
============
This page is still under construction. All of the following are the commands we have reverse engineered. It is not an exhaustive list of all the possible commands.

Commands do not immediately make it to this page. You can find more commands [here](https://github.com/humbertogontijo/python-roborock/blob/main/roborock/roborock_typing.py#L18)

Commands can have multiple parameters that can change from one model to another.

* :ref:`app_charge`
Expand Down
37 changes: 37 additions & 0 deletions roborock/code_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ class RoborockStateCode(RoborockEnum):
segment_cleaning = 18
emptying_the_bin = 22 # on s7+
washing_the_mop = 23 # on a46
washing_the_mop_2 = 25
going_to_wash_the_mop = 26 # on a46
in_call = 28
mapping = 29
egg_attack = 30
patrol = 32
charging_complete = 100
device_offline = 101
locked = 103
Expand Down Expand Up @@ -126,6 +128,7 @@ class RoborockErrorCode(RoborockEnum):
side_brush_error = 17
fan_error = 18
dock = 19 # Dock not connected to power
optical_flow_sensor_dirt = 20
vertical_bumper_pressed = 21
dock_locator_error = 22
return_to_dock_fail = 23
Expand All @@ -150,7 +153,14 @@ class RoborockErrorCode(RoborockEnum):
clear_brush_exception_2 = 43 # Positioning button error
filter_screen_exception = 44 # Clean the dock water filter
mopping_roller_2 = 45 # Wash roller may be jammed
up_water_exception = 48
drain_water_exception = 49
temperature_protection = 51 # Unit temperature protection
clean_carousel_exception = 52
clean_carousel_water_full = 53
water_carriage_drop = 54
check_clean_carouse = 55
audio_error = 56


class RoborockFanPowerCode(RoborockEnum):
Expand Down Expand Up @@ -236,6 +246,14 @@ class RoborockFanSpeedP10(RoborockFanPowerCode):
max_plus = 108


class RoborockFanSpeedS8MaxVUltra(RoborockFanPowerCode):
off = 105
balanced = 102
custom = 106
max_plus = 108
smart_mode = 110


class RoborockMopModeCode(RoborockEnum):
"""Describes the mop mode of the vacuum cleaner."""

Expand All @@ -257,6 +275,15 @@ class RoborockMopModeS8ProUltra(RoborockMopModeCode):
custom = 302


class RoborockMopModeS8MaxVUltra(RoborockMopModeCode):
standard = 300
deep = 301
deep_plus = 303
fast = 304
deep_plus_pearl = 305
smart_mode = 306


class RoborockMopIntensityCode(RoborockEnum):
"""Describes the mop intensity of the vacuum cleaner."""

Expand Down Expand Up @@ -292,6 +319,14 @@ class RoborockMopIntensityP10(RoborockMopIntensityCode):
custom_water_flow = 207


class RoborockMopIntensityS8MaxVUltra(RoborockMopIntensityCode):
off = 200
low = 201
medium = 202
smart_mode = 209
custom_water_flow = 207


class RoborockMopIntensityS5Max(RoborockMopIntensityCode):
"""Describes the mop intensity of the vacuum cleaner."""

Expand Down Expand Up @@ -321,6 +356,7 @@ class RoborockDockErrorCode(RoborockEnum):
duct_blockage = 34
water_empty = 38
waste_water_tank_full = 39
maintenance_brush_jammed = 42
dirty_tank_latch_open = 44
no_dustbin = 46
cleaning_tank_full_or_blocked = 53
Expand All @@ -335,6 +371,7 @@ class RoborockDockTypeCode(RoborockEnum):
s7_max_ultra_dock = 6
s8_dock = 7
p10_dock = 8
s8_maxv_ultra_dock = 10


class RoborockDockDustCollectionModeCode(RoborockEnum):
Expand Down
1 change: 1 addition & 0 deletions roborock/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
ROBOROCK_S8_PRO_ULTRA = "roborock.vacuum.a70"
ROBOROCK_S8 = "roborock.vacuum.a51"
ROBOROCK_P10 = "roborock.vacuum.a75"
ROBOROCK_S8_MAXV_ULTRA = "roborock.vacuum.a97"

ROBOROCK_DYAD_AIR = "roborock.wetdryvac.a107"
ROBOROCK_DYAD_PRO_COMBO = "roborock.wetdryvac.a83"
Expand Down
12 changes: 12 additions & 0 deletions roborock/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@
RoborockFanSpeedS6Pure,
RoborockFanSpeedS7,
RoborockFanSpeedS7MaxV,
RoborockFanSpeedS8MaxVUltra,
RoborockMopIntensityCode,
RoborockMopIntensityP10,
RoborockMopIntensityS5Max,
RoborockMopIntensityS6MaxV,
RoborockMopIntensityS7,
RoborockMopIntensityS8MaxVUltra,
RoborockMopIntensityV2,
RoborockMopModeCode,
RoborockMopModeS7,
RoborockMopModeS8MaxVUltra,
RoborockMopModeS8ProUltra,
RoborockStateCode,
)
Expand All @@ -52,6 +55,7 @@
ROBOROCK_S7,
ROBOROCK_S7_MAXV,
ROBOROCK_S8,
ROBOROCK_S8_MAXV_ULTRA,
ROBOROCK_S8_PRO_ULTRA,
SENSOR_DIRTY_REPLACE_TIME,
SIDE_BRUSH_REPLACE_TIME,
Expand Down Expand Up @@ -550,6 +554,13 @@ class P10Status(Status):
mop_mode: RoborockMopModeS8ProUltra | None = None


@dataclass
class S8MaxvUltraStatus(Status):
fan_power: RoborockFanSpeedS8MaxVUltra | None = None
water_box_mode: RoborockMopIntensityS8MaxVUltra | None = None
mop_mode: RoborockMopModeS8MaxVUltra | None = None


ModelStatus: dict[str, type[Status]] = {
ROBOROCK_S4_MAX: S4MaxStatus,
ROBOROCK_S5_MAX: S5MaxStatus,
Expand All @@ -563,6 +574,7 @@ class P10Status(Status):
ROBOROCK_S8_PRO_ULTRA: S8ProUltraStatus,
ROBOROCK_G10S_PRO: S7MaxVStatus,
ROBOROCK_P10: P10Status,
ROBOROCK_S8_MAXV_ULTRA: S8MaxvUltraStatus,
}


Expand Down
29 changes: 29 additions & 0 deletions roborock/roborock_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ class RoborockCommand(str, Enum):
APP_RC_START = "app_rc_start"
APP_RC_STOP = "app_rc_stop"
APP_RESUME_BUILD_MAP = "app_resume_build_map"
APP_RESUME_PATROL = "app_resume_patrol"
APP_SEGMENT_CLEAN = "app_segment_clean"
APP_SET_AMETHYST_STATUS = "app_set_amethyst_status"
APP_SET_CARPET_DEEP_CLEAN_STATUS = "app_set_carpet_deep_clean_status"
APP_SET_CROSS_CARPET_CLEANING_STATUS = "app_set_cross_carpet_cleaning_status"
APP_SET_DOOR_SILL_BLOCKS = "app_set_door_sill_blocks"
APP_SET_DIRTY_REPLENISH_CLEAN_STATUS = "app_set_dirty_replenish_clean_status"
APP_SET_DRYER_SETTING = "app_set_dryer_setting"
APP_SET_DRYER_STATUS = "app_set_dryer_status"
APP_SET_DYNAMIC_CONFIG = "app_set_dynamic_config"
Expand All @@ -50,6 +53,8 @@ class RoborockCommand(str, Enum):
APP_START_BUILD_MAP = "app_start_build_map"
APP_START_COLLECT_DUST = "app_start_collect_dust"
APP_START_EASTER_EGG = "app_start_easter_egg"
APP_START_PATROL = "app_start_patrol"
APP_START_PET_PATROL = "app_start_pet_patrol"
APP_START_WASH = "app_start_wash"
APP_STAT = "app_stat"
APP_STOP = "app_stop"
Expand Down Expand Up @@ -177,6 +182,7 @@ class RoborockCommand(str, Enum):
SET_CLEAN_FOLLOW_GROUND_MATERIAL_STATUS = "set_clean_follow_ground_material_status"
SET_CLEAN_MOTOR_MODE = "set_clean_motor_mode"
SET_CLEAN_SEQUENCE = "set_clean_sequence"
SET_CLEAN_REPEAT_TIMES = "set_clean_repeat_times"
SET_COLLISION_AVOID_STATUS = "set_collision_avoid_status"
SET_CUSTOM_MODE = "set_custom_mode"
SET_CUSTOMIZE_CLEAN_MODE = "set_customize_clean_mode"
Expand Down Expand Up @@ -239,6 +245,29 @@ class RoborockCommand(str, Enum):
USE_NEW_MAP = "use_new_map"
USE_OLD_MAP = "use_old_map"
USER_UPLOAD_LOG = "user_upload_log"
SET_STRETCH_TAG_STATUS = "set_stretch_tag_status"
GET_STRETCH_TAG_STATUS = "get_stretch_tag_status"
SET_RIGHT_BRUSH_STRETCH_STATUS = "set_right_brush_stretch_status"
GET_RIGHT_BRUSH_STRETCH_STATUS = "get_right_brush_stretch_status"
SET_DIRTY_OBJECT_DETECT_STATUS = "set_dirty_object_detect_status"
GET_DIRTY_OBJECT_DETECT_STATUS = "get_dirty_object_detect_status"
SET_WASH_WATER_TEMPERATURE = "set_wash_water_temperature"
GET_WASH_WATER_TEMPERATURE = "get_wash_water_temperature"
APP_EMPTY_RINSE_TANK_WATER = "app_empty_rinse_tank_water"
SET_PET_SUPPLIES_DEEP_CLEAN_STATUS = "set_pet_supplies_deep_clean_status"
GET_PET_SUPPLIES_DEEP_CLEAN_STATUS = "get_pet_supplies_deep_clean_status"
SET_AP_MIC_LED_STATUS = "set_ap_mic_led_status"
GET_AP_MIC_LED_STATUS = "get_ap_mic_led_status"
SET_HANDLE_LEAK_WATER_STATUS = "set_handle_leak_water_status"
GET_HANDLE_LEAK_WATER_STATUS = "get_handle_leak_water_status"
APP_IGNORE_DIRTY_OBJECTS = "app_ignore_dirty_objects"
MATTER_GET_STATUS = "matter.get_status"
MATTER_DNLD_KEY = "matter.dnld_key"
MATTER_RESET = "matter.reset"
SET_GAP_DEEP_CLEAN_STATUS = "set_gap_deep_clean_status"
GET_GAP_DEEP_CLEAN_STATUS = "get_gap_deep_clean_status"
APP_SET_ROBOT_SETTING = "app_set_robot_setting"
APP_GET_ROBOT_SETTING = "app_get_robot_setting"


@dataclass
Expand Down

0 comments on commit aaaf0f0

Please sign in to comment.