diff --git a/roborock/devices/traits/a01/__init__.py b/roborock/devices/traits/a01/__init__.py index afa884e1..e804f23c 100644 --- a/roborock/devices/traits/a01/__init__.py +++ b/roborock/devices/traits/a01/__init__.py @@ -21,7 +21,7 @@ def __init__(self, channel: MqttChannel) -> None: async def query_values(self, protocols: list[RoborockDyadDataProtocol]) -> dict[RoborockDyadDataProtocol, Any]: """Query the device for the values of the given Dyad protocols.""" - params = {RoborockDyadDataProtocol.ID_QUERY: [int(p) for p in protocols]} + params = {RoborockDyadDataProtocol.ID_QUERY: str([int(p) for p in protocols])} return await send_decoded_command(self._channel, params) async def set_value(self, protocol: RoborockDyadDataProtocol, value: Any) -> dict[RoborockDyadDataProtocol, Any]: @@ -41,7 +41,7 @@ def __init__(self, channel: MqttChannel) -> None: async def query_values(self, protocols: list[RoborockZeoProtocol]) -> dict[RoborockZeoProtocol, Any]: """Query the device for the values of the given protocols.""" - params = {RoborockZeoProtocol.ID_QUERY: [int(p) for p in protocols]} + params = {RoborockZeoProtocol.ID_QUERY: str([int(p) for p in protocols])} return await send_decoded_command(self._channel, params) async def set_value(self, protocol: RoborockZeoProtocol, value: Any) -> dict[RoborockZeoProtocol, Any]: diff --git a/tests/devices/test_a01_channel.py b/tests/devices/test_a01_channel.py index 1939f16d..70f1ade3 100644 --- a/tests/devices/test_a01_channel.py +++ b/tests/devices/test_a01_channel.py @@ -45,6 +45,9 @@ async def test_id_query(mock_mqtt_channel: FakeChannel): result = await send_decoded_command(mock_mqtt_channel, params) # type: ignore[call-overload] # Assertions - assert result == {RoborockDyadDataProtocol.WARM_LEVEL: 101, RoborockDyadDataProtocol.POWER: 75} + assert result == { + RoborockDyadDataProtocol.WARM_LEVEL: 101, + RoborockDyadDataProtocol.POWER: 75, + } mock_mqtt_channel.publish.assert_awaited_once() mock_mqtt_channel.subscribe.assert_awaited_once() diff --git a/tests/devices/traits/a01/test_init.py b/tests/devices/traits/a01/test_init.py index 366d8ddf..05601eff 100644 --- a/tests/devices/traits/a01/test_init.py +++ b/tests/devices/traits/a01/test_init.py @@ -69,7 +69,7 @@ async def test_dyad_api_query_values(mock_channel: AsyncMock, mock_send: AsyncMo call( mock_channel, { - RoborockDyadDataProtocol.ID_QUERY: [209, 201, 207, 214, 215, 227, 229, 230, 222, 224], + RoborockDyadDataProtocol.ID_QUERY: "[209, 201, 207, 214, 215, 227, 229, 230, 222, 224]", }, ), ] @@ -176,7 +176,7 @@ async def test_zeo_api_query_values(mock_channel: AsyncMock, mock_send: AsyncMoc call( mock_channel, { - RoborockZeoProtocol.ID_QUERY: [203, 207, 226, 227, 224, 218], + RoborockZeoProtocol.ID_QUERY: "[203, 207, 226, 227, 224, 218]", }, ), ]