Repository navigation
Conversation
79587b6 to
cde6801
Compare
|
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:
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. |
|
Thanks for the careful look, both are fair questions.
And yes, #1028 is merged, so the diff here is just the three photo files and nothing's blocking it. |
saruk-vedant
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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
-
DeviceFeaturesis the single source of truth for V1 capabilities.
DeviceFeaturesTraitis a thin transport/caching wrapper aroundDeviceFeatures—every other trait'srequires_feature(camera,child_lock,customize_clean_mode,flow_led_status,led_status,valley_electricity_timer) points to a declared@dataclassboolean field onDeviceFeatures. Putting a capability predicate as a@propertyonDeviceFeaturesTraitsplits the capability model:- Callers using
DeviceFeatures.from_feature_flags(...)directly (CLI, tests, diagnostics) won't see the capability. DeviceFeatures.get_supported_features()inspectsvars(self), so@propertymethods are omitted from diagnostics.tests/test_supported_features.pysnapshot coverage andDeviceFeatures.from_dict()stale-cache invalidation (which checksfields(cls)) only track declared dataclass fields.
- Callers using
-
We gate on
ProductFeatures/RoborockProductNickname, not raw"roborock.vacuum.*"strings.
Models are mapped once inroborock/data/code_mappings.py(SHORT_MODEL_TO_ENUM→RoborockProductNickname), andDeviceFeaturesfields declare their capability source via field metadata—for example, right alongsideis_ai_recognition_obstacle_supportedinroborock/device_features.py:is_support_water_mode: bool = field( metadata={ "product_features": [ ProductFeatures.MOP_ELECTRONIC_MODULE, ProductFeatures.MOP_SHAKE_MODULE, ProductFeatures.MOP_SPIN_MODULE, ] } )
-
PRODUCT_FEATURE_MAPalready distinguishes camera hardware.
Every nickname inPRODUCT_FEATURE_MAPwithAIRECOGNITION_OBSTACLEalready has one of four mutually exclusive camera tags pulled from the Roborock app:CAMERA_RGB(28 nicknames, e.g., S7 MaxVTOPAZSV, Saros 10/10R, Qrevo MaxV/Curv)CAMERA_DOUBLERGB(1 nickname: S6 MaxVTANOSV)CAMERA_DUALLINE(6 nicknames, e.g., S8ULTRON, S8 Pro UltraULTRONSPLUS, S7 Max UltraTOPAZSPLUS)CAMERA_SINGLELINE(16 nicknames, e.g., Q RevoPEARL, Qrevo S/ProPEARLC/PEARLS, Qrevo 2 ProQUINN)
Single-line structured-light models (
CAMERA_SINGLELINE) have no camera hardware at all (our existinghome_data_device_q_revo.jsonandhome_data_device_pearls.jsonfixtures have the same false positive asa294). The only ambiguous group isCAMERA_DUALLINE(sinceTANOSSPLUS,TANOSSMAX, andULTRONappear inis_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
left a comment
There was a problem hiding this comment.
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)
a294is Qrevo 2 Pro / Quinn. Confirmed.module_1567.js:357-359mapsPD.Quinnto short models['a293', 'a294'], which matchesQUINNinroborock/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.SingleLineCameraFeaturescontainsCamera_SingleLine+AIRecognition_Setting+AIRecognition_Obstacle(module_1566.js:61-83). This matchesPEARL_FEATURESinroborock/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_RGBorMF.Camera_DoubleRGBis 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
roborock/devices/traits/v1/device_features.py:13and:77-80: the capability is a model-string blocklist in a@propertyonDeviceFeaturesTrait, not aDeviceFeaturesfield.-
What breaks:
- Every other
requires_featurepoints at a declared field onDeviceFeatures(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()usesvars(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 throughRoborockProductNickname/ProductFeatures. Quinn's siblinga293still exposesobstacle_photos.
- Every other
-
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]})toDeviceFeatures. KeepingCAMERA_DUALLINEavoids changing S8 / TanosS behaviour until that is confirmed. - Point
ObstaclePhotoTrait.requires_featureat the new field. - Delete
_MODELS_WITHOUT_OBSTACLE_PHOTOSand the property. - Regenerate
tests/__snapshots__/test_supported_features.ambr.
This removes photos only for
CAMERA_SINGLELINEmodels, 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, amodel_blacklist: [RoborockProductNickname.QUINN]field onDeviceFeaturesis the smallest form that fits the codebase's conventions. - Add
-
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 withqrevo_2_pro/s7_maxvfixtures 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):pytest2818 passed / 46 xfailed, 168 snapshots passed;ruff check,ruff format --checkandmypy roborockare clean. CI is green.
This is an automated review and can be incorrect, so please reply if any finding looks wrong.
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 receivedevice.v1_properties.obstacle_photos = Nonefor 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.pyandtest_obstacle_photos.py. Related: #1018.Out of scope, possible follow-ups:
CAMERA_RGB/CAMERA_DOUBLERGBinstead 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, anduv buildpass. 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 andobstacle_photosis absent, using fresh authenticated device replies. No photo download, setting change or movement was requested.