Skip to content

fix: omit obstacle photos for Qrevo 2 Pro - #1030

Open
hCoureau wants to merge 5 commits into
Python-roborock:mainfrom
hCoureau:fix/qrevo2-pro-obstacle-photo-discovery
Open

hCoureau wants to merge 5 commits into
Python-roborock:mainfrom
hCoureau:fix/qrevo2-pro-obstacle-photo-discovery

Conversation

@hCoureau

@hCoureau hCoureau commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

The Qrevo 2 Pro (roborock.vacuum.a294) reports generic obstacle recognition, which currently causes discovery to expose obstacle-photo downloads. Give photo downloads a derived discovery predicate that excludes a294 while preserving generic recognition, raw capability flags, and other models. Consumers now receive device.v1_properties.obstacle_photos = None for a294; the S7 MaxV continues to expose the trait. The existing show-photo flag describes a separate vendor UI capability and is unchanged. Other models retain the existing recognition gate because we have no equivalent model-specific hardware evidence for them.

The owner’s app exposes manual remote control without camera viewing. Roborock’s CE manual identifies hardware model RRE0QUI; its external-sensor inventory lists single-line laser obstacle sensing and no RGB camera. The owner reports that the UK Qrevo 2 Pro box label identifies robot model RRE0QUI and dock EWFD63HRR, matching the manual. This change addresses photo discovery only.

The a294 fixture from #1028 is now on main, so this diff is limited to device_features.py, obstacle_photos.py and test_obstacle_photos.py. Related: #1018.

Out of scope, possible follow-ups:

  • a293 shares the Quinn mapping with a294 but hasn't been confirmed as the same Qrevo 2 Pro hardware. Someone with an a293 can confirm and raise a PR to add it.
  • Gating photo downloads on CAMERA_RGB/CAMERA_DOUBLERGB instead of a model list would cover other single- and dual-line models, but changes behaviour for about 20 product lines, so it should be reviewed separately.

Validation on Python 3.14.10: uv run pytest (2,286 passed, 53 xfailed), uv run pre-commit run --all-files, and uv build pass. All 11 real-broker MQTT tests pass on the combined changes on Python 3.11 and 3.14. The discovery regression fails for a294 with the old gate and passes for both a294 and the RGB S7 MaxV with the fix. Live discovery on the Qrevo 2 Pro also confirms generic recognition remains enabled and obstacle_photos is absent, using fresh authenticated device replies. No photo download, setting change or movement was requested.

@hCoureau
hCoureau force-pushed the fix/qrevo2-pro-obstacle-photo-discovery branch from 79587b6 to cde6801 Compare November 21, 2026 21:36
@saruk-vedant

Copy link
Copy Markdown
Contributor

Thanks for the clear write-up and the hardware evidence, this reads well. I checked the mechanism end to end and the behavior is right: the Qrevo 2 Pro reports AI obstacle recognition through the Quinn product features, so the old gate exposed photo downloads for a robot with no camera to take them with, and the new test pins that generic recognition stays on while obstacle_photos disappears. The S7 MaxV case staying on is a good control.

Two questions before this lands:

  1. The codebase already distinguishes single-line laser from RGB cameras in the product feature map: Quinn maps to SINGLE_LINE_CAMERA_FEATURES (CAMERA_SINGLELINE, no CAMERA_RGB) while the S7 MaxV maps to RGB_CAMERA_FEATURES. Would gating photo downloads on the product having CAMERA_RGB (or DOUBLERGB) be a better fit than a model string blocklist? It would cover future laser-only models automatically and use the capability vocabulary that is already here. I understand the conservative case for scoping to a294 only, since that is the model with hardware evidence, so I am asking rather than insisting.

  2. code_mappings lists Quinn as covering short models a293 and a294, but the blocklist only has a294. Is a293 a sibling with the same sensor set that would still expose photo downloads, or is it a different variant that does have a camera? If it shares the hardware, it probably belongs in the set too.

One small note: the dependency on #1028 looks resolved now, that fixture is on main and this diff is just the three photo files, so nothing is blocked on it anymore.

@hCoureau

Copy link
Copy Markdown
Contributor Author

Thanks for the careful look, both are fair questions.

  1. I agree the camera capability is the better long-term gate. Quinn (the Qrevo 2 Pro's internal codename, hardware RRE0QUI) maps to PEARL_FEATURES with CAMERA_SINGLELINE and no CAMERA_RGB. But switching would also turn obstacle photos off for every other single- and dual-line model that reports obstacle recognition, roughly 20 product lines across the Pearl, Ultron, Topaz, Tanos, Beryl and Quinn families. I only have hardware evidence for the a294, so I'd rather keep this PR scoped to that and do the capability gate as a follow-up, where the wider change can be reviewed on its own.

  2. a293 shares the Quinn mapping, but I don't know whether it's the same Qrevo 2 Pro hardware, so I've left it out rather than guess. If someone with an a293 can confirm it, they're welcome to raise a PR adding it.

And yes, #1028 is merged, so the diff here is just the three photo files and nothing's blocking it.

@hCoureau
hCoureau marked this pull request as ready for review November 23, 2026 22:28

@saruk-vedant saruk-vedant left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the answers. Keeping this scoped to the a294 and doing the capability gate as a follow-up makes sense, and leaving a293 out until someone confirms the hardware is the right call.

@allenporter allenporter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough investigation and hardware evidence—this is definitely a real bug. When ObstaclePhotoTrait was added in #880, gating on is_ai_recognition_obstacle_supported (ProductFeatures.AIRECOGNITION_OBSTACLE) swept in single-line laser models that report obstacle recognition icons on the map without having a camera to capture photos.

However, we shouldn't implement this as a raw model-string blocklist (_MODELS_WITHOUT_OBSTACLE_PHOTOS) and @property on DeviceFeaturesTrait in roborock/devices/traits/v1/device_features.py. That diverges from how device capabilities are modeled across python-roborock:

Why this should live in roborock/device_features.py

  1. DeviceFeatures is the single source of truth for V1 capabilities.
    DeviceFeaturesTrait is a thin transport/caching wrapper around DeviceFeatures—every other trait's requires_feature (camera, child_lock, customize_clean_mode, flow_led_status, led_status, valley_electricity_timer) points to a declared @dataclass boolean field on DeviceFeatures. Putting a capability predicate as a @property on DeviceFeaturesTrait splits the capability model:

    • Callers using DeviceFeatures.from_feature_flags(...) directly (CLI, tests, diagnostics) won't see the capability.
    • DeviceFeatures.get_supported_features() inspects vars(self), so @property methods are omitted from diagnostics.
    • tests/test_supported_features.py snapshot coverage and DeviceFeatures.from_dict() stale-cache invalidation (which checks fields(cls)) only track declared dataclass fields.
  2. We gate on ProductFeatures / RoborockProductNickname, not raw "roborock.vacuum.*" strings.
    Models are mapped once in roborock/data/code_mappings.py (SHORT_MODEL_TO_ENUM → RoborockProductNickname), and DeviceFeatures fields declare their capability source via field metadata—for example, right alongside is_ai_recognition_obstacle_supported in roborock/device_features.py:

    is_support_water_mode: bool = field(
        metadata={
            "product_features": [
                ProductFeatures.MOP_ELECTRONIC_MODULE,
                ProductFeatures.MOP_SHAKE_MODULE,
                ProductFeatures.MOP_SPIN_MODULE,
            ]
        }
    )
  3. PRODUCT_FEATURE_MAP already distinguishes camera hardware.
    Every nickname in PRODUCT_FEATURE_MAP with AIRECOGNITION_OBSTACLE already has one of four mutually exclusive camera tags pulled from the Roborock app:

    • CAMERA_RGB (28 nicknames, e.g., S7 MaxV TOPAZSV, Saros 10/10R, Qrevo MaxV/Curv)
    • CAMERA_DOUBLERGB (1 nickname: S6 MaxV TANOSV)
    • CAMERA_DUALLINE (6 nicknames, e.g., S8 ULTRON, S8 Pro Ultra ULTRONSPLUS, S7 Max Ultra TOPAZSPLUS)
    • CAMERA_SINGLELINE (16 nicknames, e.g., Q Revo PEARL, Qrevo S/Pro PEARLC/PEARLS, Qrevo 2 Pro QUINN)

    Single-line structured-light models (CAMERA_SINGLELINE) have no camera hardware at all (our existing home_data_device_q_revo.json and home_data_device_pearls.json fixtures have the same false positive as a294). The only ambiguous group is CAMERA_DUALLINE (since TANOSSPLUS, TANOSSMAX, and ULTRON appear in is_show_obstacle_photo_supported).

Suggested Approach

Define a declarative DeviceFeatures field in roborock/device_features.py using ProductFeatures, and point ObstaclePhotoTrait.requires_feature at it. To stay conservative around CAMERA_DUALLINE (S8 / S8 Pro Ultra) while cleanly excluding all camera-less CAMERA_SINGLELINE models (including QUINN, PEARL, etc.):

--- a/roborock/device_features.py
+++ b/roborock/device_features.py
@@ -578,6 +578,13 @@ class DeviceFeatures(RoborockBase):
     is_ai_recognition_obstacle_supported: bool = field(
         metadata={"product_features": [ProductFeatures.AIRECOGNITION_OBSTACLE]}
     )
+    is_obstacle_photo_supported: bool = field(
+        metadata={
+            "product_features": [
+                ProductFeatures.CAMERA_RGB,
+                ProductFeatures.CAMERA_DOUBLERGB,
+                ProductFeatures.CAMERA_DUALLINE,
+            ]
+        }
+    )
--- a/roborock/devices/traits/v1/obstacle_photos.py
+++ b/roborock/devices/traits/v1/obstacle_photos.py
@@ -74,7 +74,7 @@ class ObstaclePhotoTrait(RoborockBase, common.V1TraitMixin):
     command = RoborockCommand.GET_PHOTO
     converter = ObstaclePhotoConverter()
     blob_rpc_channel = True
-    requires_feature = "is_ai_recognition_obstacle_supported"
+    requires_feature = "is_obstacle_photo_supported"

(If we confirm CAMERA_DUALLINE models don't support get_photo either, dropping CAMERA_DUALLINE later is a one-line change in the same field—and adding a field on DeviceFeatures also automatically invalidates stale cached features via DeviceFeatures.from_dict().)

Then remove _MODELS_WITHOUT_OBSTACLE_PHOTOS and the @property from roborock/devices/traits/v1/device_features.py, and update the DeviceFeatures snapshots (tests/__snapshots__/test_supported_features.ambr, etc.) alongside your discovery test in tests/devices/traits/v1/test_obstacle_photos.py.

@Lash-L Lash-L left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated code review by Claude Opus 5.5 in Claude Code using our /review (/code-review) skill (.agents/skills/code-review/SKILL.md / AGENTS.md).

Summary

Verdict: Does not pass /review.

Reviewed head 9c16c6f against origin/main (cfa413e). It merges cleanly. The bug is real. ObstaclePhotoTrait is gated on AIRECOGNITION_OBSTACLE, and single-line laser models such as Quinn (a293/a294) report that flag even though they have no camera that can take photos. The fix has the right effect for a294 and changes nothing for other models. The blocker is where the gate lives and how it is written, which is the same point as the maintainer's open CHANGES_REQUESTED review on this commit. I checked that review against the code and the app bundle, and it holds up.

Claims checked against the RR_API app bundle (hermes/com.roborock.tanos/output)

  • a294 is Qrevo 2 Pro / Quinn. Confirmed. module_1567.js:357-359 maps PD.Quinn to short models ['a293', 'a294'], which matches QUINN in roborock/data/code_mappings.py:220.
  • Quinn is a single-line (no RGB) model that still reports obstacle recognition. Consistent. Quinn inherits its config chain in module_1567.js:340-362. SingleLineCameraFeatures contains Camera_SingleLine + AIRecognition_Setting + AIRecognition_Obstacle (module_1566.js:61-83). This matches PEARL_FEATURES in roborock/device_features.py:135-150.
  • The app limits photo features to RGB-camera models. Confirmed. The photo-privacy / map-object-photo control in the AI-recognition settings page only shows when MF.Camera_RGB or MF.Camera_DoubleRGB is supported (module_3234.js:1293-1310). isShowObstaclePhoto (module_443.js:812) is a separate debug whitelist (TanosSPlus etc.), as the PR body says.
  • No RGB camera on RRE0QUI hardware: unverifiable from RR_API (it comes from the external manual and sensor inventory). It is consistent with the above.

Priority 1: Public Trait APIs & Consumer Contracts

  1. roborock/devices/traits/v1/device_features.py:13 and :77-80: the capability is a model-string blocklist in a @property on DeviceFeaturesTrait, not a DeviceFeatures field.
    • What breaks:

      • Every other requires_feature points at a declared field on DeviceFeatures (roborock/device_features.py). This one points at a property that only exists on the trait wrapper.
      • DeviceFeatures.from_feature_flags(...) callers never see the capability. get_supported_features() uses vars(self) (roborock/device_features.py:712-714), so diagnostics leave it out.
      • Snapshot coverage and the from_dict() stale-cache check (:693-706, fields(cls)) don't track it either.
      • "roborock.vacuum.a294" is also a raw string, where the codebase models devices through RoborockProductNickname / ProductFeatures. Quinn's sibling a293 still exposes obstacle_photos.
    • Fix: do what the maintainer review suggests:

      • Add is_obstacle_photo_supported: bool = field(metadata={"product_features": [ProductFeatures.CAMERA_RGB, ProductFeatures.CAMERA_DOUBLERGB, ProductFeatures.CAMERA_DUALLINE]}) to DeviceFeatures. Keeping CAMERA_DUALLINE avoids changing S8 / TanosS behaviour until that is confirmed.
      • Point ObstaclePhotoTrait.requires_feature at the new field.
      • Delete _MODELS_WITHOUT_OBSTACLE_PHOTOS and the property.
      • Regenerate tests/__snapshots__/test_supported_features.ambr.

      This removes photos only for CAMERA_SINGLELINE models, and the app bundle above says those have no photo capability. That makes it the evidence-backed version of "about 20 product lines" rather than a speculative one. If the wider change is still not wanted in this PR, a model_blacklist: [RoborockProductNickname.QUINN] field on DeviceFeatures is the smallest form that fits the codebase's conventions.

Priority 2 / 3

No findings. The trait-discovery path (roborock/devices/traits/v1/__init__.py:335-340) works with the property through getattr, and there are no protocol changes.

Tests & PR hygiene

  • tests/devices/traits/v1/test_obstacle_photos.py:122-139: the parametrized discovery test with qrevo_2_pro / s7_maxv fixtures is placed and structured well. Keep it when you move to the field, and add a single-line fixture already on main (home_data_device_q_revo.json / pearls) plus a dual-line one, so each camera class is pinned.
  • Local run on 9c16c6f (Python 3.13): pytest 2818 passed / 46 xfailed, 168 snapshots passed; ruff check, ruff format --check and mypy roborock are clean. CI is green.

This is an automated review and can be incorrect, so please reply if any finding looks wrong.

@Lash-L Lash-L added the /review run Code review skill (/review) has been run label Nov 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working /review run Code review skill (/review) has been run V1 V1 platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants