Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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()
Loading