From 29cffbd20cbeba948b5d3b07276f4aaa7b37288c Mon Sep 17 00:00:00 2001 From: "Andrew L. Yeats" <6013718+andrewlyeats@users.noreply.github.com> Date: Mon, 22 Jun 2026 20:26:19 -0400 Subject: [PATCH] fix: key B01/Q10 RemoteTrait COMMON params by the DP code, not the enum member RemoteTrait._send_remote keyed the dpCommon(101) params by the enum member B01_Q10_DP.REMOTE (which serialises to "dpRemote") instead of the DP code "12", so the B01/Q10 firmware silently ignored all five remote-drive directions. Key by str(B01_Q10_DP.REMOTE.code) to match the {str(dp.code): value} form the Q10 settings writers use (and the #852 REST fix). Live-validated on a Q10 S5+ (ss07); the five test_remote expected payloads updated from "dpRemote" to "12". --- roborock/devices/traits/b01/q10/remote.py | 2 +- tests/devices/traits/b01/q10/test_remote.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roborock/devices/traits/b01/q10/remote.py b/roborock/devices/traits/b01/q10/remote.py index 2d860faa..450d1901 100644 --- a/roborock/devices/traits/b01/q10/remote.py +++ b/roborock/devices/traits/b01/q10/remote.py @@ -20,7 +20,7 @@ def __init__(self, command: CommandTrait) -> None: self._command = command async def _send_remote(self, action: RemoteCommand) -> None: - await self._command.send(B01_Q10_DP.COMMON, params={B01_Q10_DP.REMOTE: action.value}) + await self._command.send(B01_Q10_DP.COMMON, params={str(B01_Q10_DP.REMOTE.code): action.value}) async def forward(self) -> None: """Move forward.""" diff --git a/tests/devices/traits/b01/q10/test_remote.py b/tests/devices/traits/b01/q10/test_remote.py index 1fdf1306..4de8c986 100644 --- a/tests/devices/traits/b01/q10/test_remote.py +++ b/tests/devices/traits/b01/q10/test_remote.py @@ -27,11 +27,11 @@ def remote_fixture(q10_api: Q10PropertiesApi) -> RemoteTrait: @pytest.mark.parametrize( ("command_fn", "expected_payload"), [ - (lambda x: x.forward(), {"101": {"dpRemote": 0}}), - (lambda x: x.left(), {"101": {"dpRemote": 2}}), - (lambda x: x.right(), {"101": {"dpRemote": 3}}), - (lambda x: x.stop(), {"101": {"dpRemote": 4}}), - (lambda x: x.exit_remote(), {"101": {"dpRemote": 5}}), + (lambda x: x.forward(), {"101": {"12": 0}}), + (lambda x: x.left(), {"101": {"12": 2}}), + (lambda x: x.right(), {"101": {"12": 3}}), + (lambda x: x.stop(), {"101": {"12": 4}}), + (lambda x: x.exit_remote(), {"101": {"12": 5}}), ], ) async def test_remote_commands(