Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions roborock/devices/traits/a01/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand All @@ -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]:
Expand Down
5 changes: 4 additions & 1 deletion tests/devices/test_a01_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions tests/devices/traits/a01/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
},
),
]
Expand Down Expand Up @@ -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]",
},
),
]
Expand Down