diff --git a/roborock/roborock_typing.py b/roborock/roborock_typing.py index 37cdf4d9..d310248e 100644 --- a/roborock/roborock_typing.py +++ b/roborock/roborock_typing.py @@ -77,6 +77,7 @@ class RoborockCommand(str, Enum): GET_CHILD_LOCK_STATUS = "get_child_lock_status" GET_CLEAN_FOLLOW_GROUND_MATERIAL_STATUS = "get_clean_follow_ground_material_status" GET_CLEAN_MOTOR_MODE = "get_clean_motor_mode" + GET_CLEAN_DETAIL = "get_clean_detail" GET_CLEAN_RECORD = "get_clean_record" GET_CLEAN_RECORD_MAP = "get_clean_record_map" GET_CLEAN_SEQUENCE = "get_clean_sequence" @@ -123,6 +124,7 @@ class RoborockCommand(str, Enum): GET_RECOVER_MAP = "get_recover_map" GET_RECOVER_MAPS = "get_recover_maps" GET_ROOM_MAPPING = "get_room_mapping" + GET_RT_CLEAN_DETAIL = "get_rt_clean_detail" GET_SCENES_VALID_TIDS = "get_scenes_valid_tids" GET_SEGMENT_STATUS = "get_segment_status" GET_SERIAL_NUMBER = "get_serial_number" diff --git a/tests/devices/traits/v1/test_command.py b/tests/devices/traits/v1/test_command.py index 972f0615..baa38cb1 100644 --- a/tests/devices/traits/v1/test_command.py +++ b/tests/devices/traits/v1/test_command.py @@ -59,3 +59,29 @@ async def test_send_command_propagates_exception(command_trait: CommandTrait) -> # Verify the exception is propagated with pytest.raises(RoborockException, match="Communication error"): await command_trait.send(RoborockCommand.APP_START) + + +@pytest.mark.parametrize( + ("command", "params"), + [ + (RoborockCommand.GET_RT_CLEAN_DETAIL, {"type": 0, "from": 0}), + (RoborockCommand.GET_CLEAN_DETAIL, {"begin": 1794867592, "type": 0, "id": 0, "from": 0}), + ], +) +async def test_send_clean_detail(command_trait: CommandTrait, command: RoborockCommand, params: dict) -> None: + """Test the clean timeline commands with the parameters a Saros 10R accepts.""" + mock_rpc_channel = command_trait._rpc_channel + assert mock_rpc_channel is not None + response = { + "begin": 1794867592, + "from": 0, + "num": 1, + "more": 0, + "events": [{"t": 1794867611, "i": 41, "e": '{"2":8}'}], + } + mock_rpc_channel.send_command.return_value = response + + result = await command_trait.send(command, params) + + assert result == response + mock_rpc_channel.send_command.assert_called_once_with(command, params=params)