From c00200b462b4afdbbf4b892fadeb864fa9b6e713 Mon Sep 17 00:00:00 2001 From: Jameson Toper Date: Thu, 22 Oct 2026 20:20:49 -0700 Subject: [PATCH 1/2] docs: add QX Revo Ultra 2 (a298) to tested vacuums Onboarded successfully on server v1.2.1 with an Actalis certificate via Cloudflare DNS-01. Firmware 02.15.44 is shared with the QRevo Edge 2 Set row. Verified over a 5-day window: cloud-free operation under a full router outbound block, /f/c rrcheck accepted on 6 daily requests, map streaming and app_start/app_charge working, 104 MQTT connections with no errors. Compatibility report: #193 --- docs/tested_vacuums.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/tested_vacuums.md b/docs/tested_vacuums.md index ea01e3eb..a26e126d 100644 --- a/docs/tested_vacuums.md +++ b/docs/tested_vacuums.md @@ -89,6 +89,7 @@ Cloudflare can provide DNS validation for several certificate issuers. Its use a | QRevo S5V (a170) | `02.09.70` | ❓ | ❓ | ❓ | ❓ | [#52](https://github.com/Python-roborock/local_roborock_server/issues/52#issuecomment-4826867624) | | QRevo S5V (a170) | `02.16.64` | ❓ | ❓ | ✅ | ❓ | [#52](https://github.com/Python-roborock/local_roborock_server/issues/52) | | QRevo S Pro (a326) | `02.36.38` | ❓ | ❓ | ✅ | ❓ | [#132](https://github.com/Python-roborock/local_roborock_server/issues/132) | +| QX Revo Ultra 2 (a298) | `02.15.44` | ❓ | ✅ | ❓ | ❓ | [#193](https://github.com/Python-roborock/local_roborock_server/issues/193) | | QX Revo Plus (Costco version) | Not reported | ❓ | ❓ | ✅ | ❓ | [#89](https://github.com/Python-roborock/local_roborock_server/pull/89) | Setup notes: @@ -106,6 +107,7 @@ Setup notes: - QRevo Curv 2 Pro: the map initially failed to load; regenerating the server public key and re-onboarding restored it. - QRevo S Pro: the successful report used an RSA-2048 Let's Encrypt certificate. An [earlier attempt](https://github.com/Python-roborock/local_roborock_server/issues/67) on the same firmware stopped before Wi-Fi configuration was sent. - QRevo Master: the SSL.com result used a Sectigo Public Server Authentication CA DV R36 chain and a workaround for the proxy MQTT onboarding issue in [#83](https://github.com/Python-roborock/local_roborock_server/issues/83). +- QX Revo Ultra 2 (a298): shares its model code and firmware (`02.15.44`) with the QRevo Edge 2 Set row. Onboarded with the project CLI after LocalRock's v5 auth flow returned `401 missing_authorization`. Public key recovery used `header_samples` rather than `query_samples`. Cloud-free operation was verified under a full router outbound block, and the `/f/c` rrcheck was accepted on 6 daily requests over 5 days. ## Unlisted Vacuums From 9576e80fd6404e4e8f2c0729b4ae6ab79ba38578 Mon Sep 17 00:00:00 2001 From: Jameson Toper Date: Thu, 22 Oct 2026 22:15:36 -0700 Subject: [PATCH 2/2] feat(camera): add camera-activate for the local two-key activation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The QX Revo Ultra 2 (a298, firmware 02.15.44) does not enable remote viewing from set_homesec_password alone. Its firmware expects the remote-view app to write set_camera_status twice — bit 5, then bit 12 — and then a physical Power press on the robot within about a minute. The firmware clears bit 12 and sets the read-only monitor bit 2 itself, which is what authorizes start_camera_preview. Writing either bit directly is rejected, and re-onboarding or changing the camera PIN resets it. camera-activate reads camera_status, writes the two request values, and polls for the monitor bit while the operator presses Power. Verified on the a298: the command reports an already-authorized camera (8613) without rewriting it, and docs/camera.md records the sequence. --- docs/camera.md | 20 +++ docs/tested_vacuums.md | 4 +- src/roborock_local_server/__main__.py | 14 +- .../bundled_backend/shared/routine_runner.py | 11 +- src/roborock_local_server/camera.py | 89 ++++++++++++ src/roborock_local_server/server.py | 137 +++++++++++++++--- tests/test_camera_activation.py | 95 ++++++++++++ tests/test_routine_runner.py | 12 +- 8 files changed, 346 insertions(+), 36 deletions(-) create mode 100644 src/roborock_local_server/camera.py create mode 100644 tests/test_camera_activation.py diff --git a/docs/camera.md b/docs/camera.md index 737ff75d..f5679990 100644 --- a/docs/camera.md +++ b/docs/camera.md @@ -124,6 +124,26 @@ The tested Saros 10R required two-key activation: set the remote-view PIN the two-key request bits set and monitor bit off, then press Power on the robot within about 60 seconds. Activation varies by model. +The QX Revo Ultra 2 (a298, firmware `02.15.44`) uses the same flow, and the +server can drive it: + +```bash +uv run start_local_roborock_server.py camera-activate --config config.toml +``` + +Dock the robot first and clear any error (`error_code` must be 0). The command +reads `camera_status` and writes the two request values — bit 5, then bit 12 — +which for an out-of-box a298 (`385`) is `417` then `4513`. Press the robot's +Power button once while it is polling. The firmware clears bit 12 and sets the +read-only monitor bit 2 itself, and `camera_status` becomes `8613`. Writing the +monitor bit directly is rejected (`-10005`), and writing the result bit +(`8611`) is rejected (`-10007`). + +Activation resets when the robot is re-onboarded or its camera PIN changes, so +rerun the command after either. With the monitor bit set, `start_camera_preview` +reaches the TURN bootstrap above; a viewer that offers an audio track gets no +SDP answer on this firmware, so the offer must be video-only. + ## Troubleshooting and tested behavior - Bootstrap falls back: inspect the actual hostname, port and path in server logs. diff --git a/docs/tested_vacuums.md b/docs/tested_vacuums.md index a26e126d..790fe0cb 100644 --- a/docs/tested_vacuums.md +++ b/docs/tested_vacuums.md @@ -89,7 +89,7 @@ Cloudflare can provide DNS validation for several certificate issuers. Its use a | QRevo S5V (a170) | `02.09.70` | ❓ | ❓ | ❓ | ❓ | [#52](https://github.com/Python-roborock/local_roborock_server/issues/52#issuecomment-4826867624) | | QRevo S5V (a170) | `02.16.64` | ❓ | ❓ | ✅ | ❓ | [#52](https://github.com/Python-roborock/local_roborock_server/issues/52) | | QRevo S Pro (a326) | `02.36.38` | ❓ | ❓ | ✅ | ❓ | [#132](https://github.com/Python-roborock/local_roborock_server/issues/132) | -| QX Revo Ultra 2 (a298) | `02.15.44` | ❓ | ✅ | ❓ | ❓ | [#193](https://github.com/Python-roborock/local_roborock_server/issues/193) | +| QX Revo Ultra 2 (a298) | `02.15.44` | ✅ | ✅ | ✅ | ❓ | [#193](https://github.com/Python-roborock/local_roborock_server/issues/193) | | QX Revo Plus (Costco version) | Not reported | ❓ | ❓ | ✅ | ❓ | [#89](https://github.com/Python-roborock/local_roborock_server/pull/89) | Setup notes: @@ -107,7 +107,7 @@ Setup notes: - QRevo Curv 2 Pro: the map initially failed to load; regenerating the server public key and re-onboarding restored it. - QRevo S Pro: the successful report used an RSA-2048 Let's Encrypt certificate. An [earlier attempt](https://github.com/Python-roborock/local_roborock_server/issues/67) on the same firmware stopped before Wi-Fi configuration was sent. - QRevo Master: the SSL.com result used a Sectigo Public Server Authentication CA DV R36 chain and a workaround for the proxy MQTT onboarding issue in [#83](https://github.com/Python-roborock/local_roborock_server/issues/83). -- QX Revo Ultra 2 (a298): shares its model code and firmware (`02.15.44`) with the QRevo Edge 2 Set row. Onboarded with the project CLI after LocalRock's v5 auth flow returned `401 missing_authorization`. Public key recovery used `header_samples` rather than `query_samples`. Cloud-free operation was verified under a full router outbound block, and the `/f/c` rrcheck was accepted on 6 daily requests over 5 days. +- QX Revo Ultra 2 (a298): shares its model code and firmware (`02.15.44`) with the QRevo Edge 2 Set row. Onboarded with the project CLI after LocalRock's v5 auth flow returned `401 missing_authorization`. Public key recovery used `header_samples` rather than `query_samples`. Cloud-free operation was verified under a full router outbound block, and the `/f/c` rrcheck was accepted on 6 daily requests over 5 days. Live video works with the provided TURN relay and a video-only WebRTC offer; remote viewing needs the local two-key activation in [camera.md](camera.md), which `camera-activate` performs. ## Unlisted Vacuums diff --git a/src/roborock_local_server/__main__.py b/src/roborock_local_server/__main__.py index a865107a..349042b4 100644 --- a/src/roborock_local_server/__main__.py +++ b/src/roborock_local_server/__main__.py @@ -10,7 +10,12 @@ from .configure import run_configure from .security import hash_password -from .server import build_arg_parser, repair_runtime_identities, run_server +from .server import ( + activate_camera_command, + build_arg_parser, + repair_runtime_identities, + run_server, +) def main() -> int: @@ -58,6 +63,13 @@ def main() -> int: if args.command == "repair-identities": return repair_runtime_identities(config_file=Path(args.config), links=list(args.link)) + if args.command == "camera-activate": + return activate_camera_command( + config_file=Path(args.config), + duid=str(args.duid), + timeout=float(args.timeout), + ) + parser.error(f"Unhandled command: {args.command}") return 2 diff --git a/src/roborock_local_server/bundled_backend/shared/routine_runner.py b/src/roborock_local_server/bundled_backend/shared/routine_runner.py index 71fcca8e..83ca92ad 100644 --- a/src/roborock_local_server/bundled_backend/shared/routine_runner.py +++ b/src/roborock_local_server/bundled_backend/shared/routine_runner.py @@ -36,6 +36,7 @@ def _ensure_local_python_roborock_on_path() -> None: __all__ = [ "RoutineCommand", "RoutineExecutionError", + "RoutineMqttClient", "RoutineRunner", "RoutineStep", "commands_for_step", @@ -431,7 +432,7 @@ def _enum_or_int_value(value: Any) -> int: return int(getattr(value, "value", value)) -class _RoutineMqttClient: +class RoutineMqttClient: def __init__( self, context: ServerContext, @@ -887,7 +888,7 @@ def add_scene(candidate: dict[str, Any]) -> None: async def _sync_scene_tids( self, *, - client: _RoutineMqttClient, + client: RoutineMqttClient, scene: dict[str, Any], device_id: str, logger: logging.LoggerAdapter, @@ -912,7 +913,7 @@ async def _stop_scene(self, *, device_id: str, scene_id: int, scene_name: str) - }, ) logger.info("Stopping routine scene=%s device=%s", scene_name, device_id) - client = _RoutineMqttClient(self._context, device, logger) + client = RoutineMqttClient(self._context, device, logger) await client.connect() try: await client.send_command(RoborockCommand.APP_STOP, []) @@ -922,7 +923,7 @@ async def _stop_scene(self, *, device_id: str, scene_id: int, scene_name: str) - async def _send_step_command( self, *, - client: _RoutineMqttClient, + client: RoutineMqttClient, logger: logging.LoggerAdapter, step: RoutineStep, routine_command: RoutineCommand, @@ -985,7 +986,7 @@ async def _run_scene(self, *, scene: dict[str, Any], steps: list[RoutineStep]) - device_id, ) - client = _RoutineMqttClient(self._context, device, logger) + client = RoutineMqttClient(self._context, device, logger) await client.connect() try: await self._sync_scene_tids(client=client, scene=scene, device_id=device_id, logger=logger) diff --git a/src/roborock_local_server/camera.py b/src/roborock_local_server/camera.py new file mode 100644 index 00000000..fc5d64ce --- /dev/null +++ b/src/roborock_local_server/camera.py @@ -0,0 +1,89 @@ +"""Local two-key camera activation. + +Some models (Saros 10R, QX Revo Ultra 2) do not enable live view from +``set_homesec_password`` alone. The firmware expects the remote-view app to write +``set_camera_status`` twice — first with the request bit 5, then with bit 12 — and +then a physical Power press on the robot within about a minute. The firmware +clears bit 12 and sets the read-only monitor bit 2, which authorizes +``start_camera_preview``. + +Only bits 5 and 12 are added; the firmware truncates/validates anything else, and +writing bit 2 or bit 13 directly is rejected. +""" + +from __future__ import annotations + +import asyncio +from dataclasses import dataclass +import time +from typing import Any + +from roborock.roborock_typing import RoborockCommand + +#: Read-only "view authorized" bit the firmware sets after a successful press. +MONITOR_BIT = 0x4 +#: First and second request bits, in the order the app writes them. +REQUEST_BITS = (0x20, 0x1000) + + +@dataclass(frozen=True) +class ActivationResult: + initial_status: int + final_status: int + activated: bool + + +def activation_writes(current_status: int) -> list[int]: + """Return the ``set_camera_status`` values that arm the two-key request. + + Each write carries the previous one forward: the firmware sees bit 5 on the + first write and bit 5 plus bit 12 on the second. + """ + + status = current_status + writes: list[int] = [] + for bit in REQUEST_BITS: + status |= bit + writes.append(status) + return writes + + +def monitor_enabled(status: int) -> bool: + """True once the firmware has granted view authorization.""" + + return bool(status & MONITOR_BIT) + + +async def _read_camera_status(client: Any) -> int: + result = await client.send_command(RoborockCommand.GET_CAMERA_STATUS) + value = result[0] if isinstance(result, list) and result else result + return int(value) + + +async def activate_camera( + client: Any, + *, + timeout_seconds: float = 90.0, + poll_interval_seconds: float = 1.0, +) -> ActivationResult: + """Arm the two-key request and wait for the monitor bit. + + The caller must press Power on the robot while this is polling. Returns once + the robot reports the monitor bit or the timeout expires. + """ + + initial = await _read_camera_status(client) + if monitor_enabled(initial): + return ActivationResult(initial_status=initial, final_status=initial, activated=True) + + for value in activation_writes(initial): + await client.send_command(RoborockCommand.SET_CAMERA_STATUS, [value]) + + deadline = time.monotonic() + timeout_seconds + while True: + status = await _read_camera_status(client) + if monitor_enabled(status): + return ActivationResult(initial_status=initial, final_status=status, activated=True) + if time.monotonic() >= deadline: + return ActivationResult(initial_status=initial, final_status=status, activated=False) + await asyncio.sleep(poll_interval_seconds) diff --git a/src/roborock_local_server/server.py b/src/roborock_local_server/server.py index 28a57654..f63eae6a 100644 --- a/src/roborock_local_server/server.py +++ b/src/roborock_local_server/server.py @@ -53,6 +53,9 @@ ) from shared.inventory_io import atomic_write_inventory, inventory_transaction from shared.protocol_auth import ProtocolAuthStore +from shared.routine_runner import RoutineMqttClient +from roborock.roborock_typing import RoborockCommand +from .camera import activate_camera from https_server.routes.user.scene import validity as scene_validity from https_server.routes.auth.service import ( build_login_data_response, @@ -2047,6 +2050,104 @@ async def run_server(*, config_file: Path, enable_standalone_admin: bool = True) return await supervisor.serve_forever() +def _build_runtime_context( + config: AppConfig, + paths: AppPaths, + runtime_credentials: RuntimeCredentialsStore, +) -> ServerContext: + """Build the minimal context the MQTT command client needs outside ``serve``.""" + + return ServerContext( + api_host=config.network.stack_fqdn, + mqtt_host=config.network.stack_fqdn, + wood_host=config.network.stack_fqdn, + region=config.network.region, + protocol_login_email=config.admin.protocol_login_email, + localkey=str(runtime_credentials.bootstrap_value("localkey", "") or ""), + duid=str(runtime_credentials.bootstrap_value("duid", "") or ""), + mqtt_usr=str(runtime_credentials.bootstrap_value("mqtt_usr", "") or ""), + mqtt_passwd=str(runtime_credentials.bootstrap_value("mqtt_passwd", "") or ""), + mqtt_clientid=str(runtime_credentials.bootstrap_value("mqtt_clientid", "") or ""), + https_port=config.network.advertised_https_port, + mqtt_tls_port=config.network.advertised_mqtt_tls_port, + http_jsonl=paths.http_jsonl_path, + mqtt_jsonl=paths.mqtt_jsonl_path, + loggers={}, + key_state_file=paths.device_key_state_path, + bootstrap_encryption_enabled=False, + runtime_state=None, + runtime_credentials=runtime_credentials, + timezone=config.network.timezone or None, + ) + + +def _single_onboarded_duid(runtime_credentials: RuntimeCredentialsStore) -> str: + duids = sorted( + {str(device.get("duid") or "").strip() for device in runtime_credentials.devices()} - {""} + ) + if not duids: + raise SystemExit("No onboarded vacuum found in runtime credentials; onboard first or pass --duid.") + if len(duids) > 1: + raise SystemExit("Multiple vacuums are onboarded; pass --duid with one of: " + ", ".join(duids)) + return duids[0] + + +async def _run_camera_activation( + client: RoutineMqttClient, + device: dict[str, str], + *, + timeout: float, +) -> int: + name = str(device.get("name") or device.get("duid") or "vacuum") + await client.connect() + try: + raw_status = await client.send_command(RoborockCommand.GET_STATUS) + status = raw_status[0] if isinstance(raw_status, list) and raw_status else raw_status + if isinstance(status, dict): + error_code = int(status.get("error_code") or 0) + if error_code: + raise SystemExit( + f"{name} reports error_code {error_code}; clear the robot error before activating." + ) + print(f"Arming the two-key camera request on {name}.") + print("Press the Power button once on the robot now.") + result = await activate_camera(client, timeout_seconds=timeout) + finally: + await client.close() + + if result.activated: + print( + f"Camera view authorized: camera_status={result.final_status} " + f"(was {result.initial_status})." + ) + print("This stays enabled until the robot is re-onboarded or its camera PIN changes.") + return 0 + + print(f"Timed out after {timeout:.0f}s: camera_status={result.final_status}.") + print("Dock the robot, clear any error, rerun this command, then press Power within 60s.") + return 1 + + +def activate_camera_command(*, config_file: Path, duid: str = "", timeout: float = 90.0) -> int: + config = load_config(config_file) + paths = resolve_paths(config_file, config) + runtime_credentials = RuntimeCredentialsStore( + paths.runtime_credentials_path, + inventory_path=paths.inventory_path, + key_state_file=paths.device_key_state_path, + ) + runtime_credentials.sync_inventory() + + selector = duid.strip() or _single_onboarded_duid(runtime_credentials) + device = runtime_credentials.device_for_selector(selector) + if device is None: + raise SystemExit(f"Vacuum '{selector}' was not found in {paths.runtime_credentials_path}") + + context = _build_runtime_context(config, paths, runtime_credentials) + client = RoutineMqttClient(context, device, logging.getLogger("roborock_local_server.camera_activate")) + return asyncio.run(_run_camera_activation(client, device, timeout=timeout)) + + def repair_runtime_identities(*, config_file: Path, links: list[str]) -> int: config = load_config(config_file) paths = resolve_paths(config_file, config) @@ -2059,28 +2160,7 @@ def repair_runtime_identities(*, config_file: Path, links: list[str]) -> int: inventory = _load_inventory(paths.inventory_path) inventory_vacuums = _extract_inventory_vacuums( - ServerContext( - api_host=config.network.stack_fqdn, - mqtt_host=config.network.stack_fqdn, - wood_host=config.network.stack_fqdn, - region=config.network.region, - protocol_login_email=config.admin.protocol_login_email, - localkey=str(runtime_credentials.bootstrap_value("localkey", "") or ""), - duid=str(runtime_credentials.bootstrap_value("duid", "") or ""), - mqtt_usr=str(runtime_credentials.bootstrap_value("mqtt_usr", "") or ""), - mqtt_passwd=str(runtime_credentials.bootstrap_value("mqtt_passwd", "") or ""), - mqtt_clientid=str(runtime_credentials.bootstrap_value("mqtt_clientid", "") or ""), - https_port=config.network.advertised_https_port, - mqtt_tls_port=config.network.advertised_mqtt_tls_port, - http_jsonl=paths.http_jsonl_path, - mqtt_jsonl=paths.mqtt_jsonl_path, - loggers={}, - key_state_file=paths.device_key_state_path, - bootstrap_encryption_enabled=False, - runtime_state=None, - runtime_credentials=runtime_credentials, - timezone=config.network.timezone or None, - ), + _build_runtime_context(config, paths, runtime_credentials), inventory, ) inventory_by_duid = {str(item.get("duid") or "").strip(): item for item in inventory_vacuums} @@ -2172,4 +2252,17 @@ def build_arg_parser() -> argparse.ArgumentParser: default=[], help="Explicit DID=DUID mapping to repair existing state; can be supplied multiple times", ) + + camera_activate = subparsers.add_parser( + "camera-activate", + help="Arm the local two-key camera activation and wait for the Power press", + ) + camera_activate.add_argument("--config", default="config.toml") + camera_activate.add_argument("--duid", default="", help="Vacuum to activate; defaults to the only onboarded one") + camera_activate.add_argument( + "--timeout", + type=float, + default=90.0, + help="Seconds to wait for the Power press after arming", + ) return parser diff --git a/tests/test_camera_activation.py b/tests/test_camera_activation.py new file mode 100644 index 00000000..c8a18554 --- /dev/null +++ b/tests/test_camera_activation.py @@ -0,0 +1,95 @@ +"""Tests for the local two-key camera activation helper. + +Models such as the Saros 10R and QX Revo Ultra 2 only enable remote viewing after +``set_camera_status`` is written with the two request bits (bit 5, then bit 12) and +the Power button is pressed on the robot. These tests pin the bit arithmetic and +the "did the monitor bit appear" poll loop without touching MQTT. +""" + +from __future__ import annotations + +import asyncio + +from roborock.roborock_typing import RoborockCommand + +from roborock_local_server.camera import ( + activate_camera, + activation_writes, + monitor_enabled, +) + + +class _FakeCameraClient: + """Records ``set_camera_status`` writes and replays ``get_camera_status`` reads.""" + + def __init__(self, statuses: list[int]) -> None: + self._statuses = list(statuses) + self.writes: list[object] = [] + + async def send_command(self, command: RoborockCommand, params: object = None) -> list[object]: + if command == RoborockCommand.GET_CAMERA_STATUS: + value = self._statuses.pop(0) if len(self._statuses) > 1 else self._statuses[0] + return [value] + self.writes.append(params) + return ["ok"] + + +def test_activation_writes_arm_the_request_bits_in_order() -> None: + assert activation_writes(385) == [417, 4513] + + +def test_activation_writes_keep_bits_that_are_already_set() -> None: + assert activation_writes(419) == [419, 4515] + + +def test_monitor_enabled_reads_the_view_authorization_bit() -> None: + assert monitor_enabled(8613) + assert not monitor_enabled(4513) + assert not monitor_enabled(417) + + +def test_already_activated_robot_is_not_rewritten() -> None: + client = _FakeCameraClient([8613]) + + result = asyncio.run(activate_camera(client, timeout_seconds=0.05)) + + assert result.activated + assert result.initial_status == 8613 + assert client.writes == [] + + +def test_activation_succeeds_when_the_robot_sets_the_monitor_bit() -> None: + client = _FakeCameraClient([417, 4513, 8613]) + + result = asyncio.run(activate_camera(client, timeout_seconds=1.0, poll_interval_seconds=0.01)) + + assert result.activated + assert result.initial_status == 417 + assert result.final_status == 8613 + assert client.writes == [[417], [4513]] + + +def test_activation_reports_timeout_when_power_is_not_pressed() -> None: + client = _FakeCameraClient([417]) + + result = asyncio.run(activate_camera(client, timeout_seconds=0.05, poll_interval_seconds=0.01)) + + assert not result.activated + assert result.initial_status == 417 + assert result.final_status == 417 + assert client.writes == [[417], [4513]] + + +def test_cli_exposes_camera_activate() -> None: + # Importing the backend bridge puts the bundled_backend dir on sys.path. + import roborock_local_server.backend as backend # noqa: F401 + + from roborock_local_server.server import build_arg_parser + + args = build_arg_parser().parse_args( + ["camera-activate", "--config", "config.toml", "--duid", "1103842126955", "--timeout", "30"] + ) + + assert args.command == "camera-activate" + assert args.duid == "1103842126955" + assert args.timeout == 30 diff --git a/tests/test_routine_runner.py b/tests/test_routine_runner.py index 40110c01..97d28d42 100644 --- a/tests/test_routine_runner.py +++ b/tests/test_routine_runner.py @@ -245,7 +245,7 @@ async def send_command(self, command, params=None): async def wait_for_step_complete(self) -> None: return None - monkeypatch.setattr(routine_runner_module, "_RoutineMqttClient", FakeRoutineClient) + monkeypatch.setattr(routine_runner_module, "RoutineMqttClient", FakeRoutineClient) runner = RoutineRunner(_test_context(tmp_path)) await runner._run_scene(scene=current_scene, steps=parse_scene_steps(current_scene)) @@ -295,7 +295,7 @@ async def send_command(self, command, params=None): async def wait_for_step_complete(self) -> None: return None - monkeypatch.setattr(routine_runner_module, "_RoutineMqttClient", FakeRoutineClient) + monkeypatch.setattr(routine_runner_module, "RoutineMqttClient", FakeRoutineClient) runner = RoutineRunner(_test_context(tmp_path)) await runner._run_scene(scene=scene, steps=parse_scene_steps(scene)) @@ -418,7 +418,7 @@ async def wait_for_step_complete(self) -> None: async def wait_for_dock_settle(self, *, initial_delay_seconds=15.0) -> None: settle_calls.append(float(initial_delay_seconds)) - monkeypatch.setattr(routine_runner_module, "_RoutineMqttClient", FakeRoutineClient) + monkeypatch.setattr(routine_runner_module, "RoutineMqttClient", FakeRoutineClient) runner = RoutineRunner(_test_context(tmp_path)) await runner._run_scene(scene=scene, steps=parse_scene_steps(scene)) @@ -445,7 +445,7 @@ async def wait_for_dock_settle(self, *, initial_delay_seconds=15.0) -> None: class _ScriptedStatusClient: - """Minimal stand-in for _RoutineMqttClient that replays a status sequence.""" + """Minimal stand-in for RoutineMqttClient that replays a status sequence.""" def __init__(self, status_sequence: list[dict]) -> None: self._statuses = [StatusV2.from_dict(s) for s in status_sequence] @@ -465,10 +465,10 @@ async def send_command(self, command: RoborockCommand, params=None) -> None: _ScriptedStatusClient.wait_for_step_complete = ( - routine_runner_module._RoutineMqttClient.wait_for_step_complete + routine_runner_module.RoutineMqttClient.wait_for_step_complete ) _ScriptedStatusClient.wait_for_dock_settle = ( - routine_runner_module._RoutineMqttClient.wait_for_dock_settle + routine_runner_module.RoutineMqttClient.wait_for_dock_settle )