Repository navigation
Conversation
A01 devices may never report data points they do not support, such as the softener data points on the Zeo Mini. A query waited for every requested data point, so it timed out, discarded the values that did arrive and counted a timeout against the MQTT session. If some requested data points arrived before the timeout, the query now returns them and counts as a success; with none it still raises. query_values reports an unreported data point as None, and Zeo keeps its known feature bits when FEATURE_BITS is not reported.
|
Hi @hCoureau! Consider joining our Roborock contributor discord to stay in touch and have easier access to us! https://discord.gg/8ytF2t5F |
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: Passes /review with nits.
#1080 changes send_decoded_command so that a query which times out with some requested data points returns them and records an MQTT success. A query that gets none still raises and calls on_timeout(). Dyad and Zeo query_values() now return None for data points the device never sent, instead of running the converter on None. Before, bool(None) turned a missing DETERGENT_EMPTY/SOFTENER_EMPTY into False, so this also fixes a quiet bug. ZeoApi._load_force_dps keeps its known feature bits when DP 237 is missing instead of resetting them to 0. The change is small and clearly scoped, and it fixes the failure in #1013: the values that do arrive are no longer thrown away, and the MQTT session no longer gets timeout strikes that restart it.
Checked against the app: the Zeo bundle (RR_API/nonhermes/com.roborock.wm/Zeo One/index.android.bundle:783, publishDp) registers its callback on the first DP in the 10000 query param (JSON.parse(e.param)[0]). It resolves on the first message that contains that DP and never waits for the full set (default timeout 10 s, and 3 s for forceLoadDps). So the library's "wait for every requested DP" rule is stricter than the app's, and accepting a partial reply is consistent with how the app behaves. Confirmed.
Priority 2: Lifecycle, State & Concurrency
roborock/devices/rpc/a01_channel.py:103-113: every partial query still takes the full 10 s (non-blocking design question). The partial result only comes back afterasyncio.wait_for(..., _TIMEOUT)expires. On a Zeo Mini (roborock.wm.a93), every periodic poll that includes the softener DPs (214/227) therefore blocks for 10 s before the coordinator gets data. The entities stay available, but each update is slow, and a device that always omits a DP pays this cost on every poll. Two ways to reduce it:- Pair this with #1090, which stops requesting DPs the model is known not to support, so known models never reach the timeout path. This PR remains the fallback for unknown models and firmware (see below).
- Or follow the app and finish soon after the first reply that contains requested DPs, for example with a short grace window after the first matching message instead of the full
_TIMEOUT. That is a larger change to the merge-across-messages logic, so it is probably better as a follow-up than as part of this PR.
Overlap with #1090 ("fix(a01): skip unsupported DPs in Zeo query_values")
- Complementary, not duplicates. #1090 filters the request with a new
supports_dp(model, dp)helper (the softener block, DP 225 and DP 237 gates indevice_feature.py).roborock.wm.a93is in_M1_SERIES, sohas_softener_compartment()returnsFalsefor it and the softener DPs are never sent. That avoids the 10 s wait, but it only covers Zeo models already in the gate tables: an unlisted model or a firmware that drops a DP still times out completely. This PR is the general safety net, and it covers Dyad as well. The best result is to merge both: #1090 for latency on known models, #1080 for resilience. - Textual conflict:
git merge-treereports a content conflict inroborock/devices/traits/a01/__init__.pyinZeoApi.query_values, where both PRs rewrite the same lines. Both use the samevalues = {... if protocol in response else None ...}comprehension, so resolving it is trivial: keep #1090'ssupportedfiltering and the shared comprehension. Whichever PR lands second needs a rebase. There are no semantic conflicts. With both merged, a query made up only of unsupported DPs sends nothing (#1090), and a query that still gets a partial reply returns the subset (#1080).
Tests & PR hygiene
- The tests sit in the mirror paths (
tests/devices/rpc/test_a01_channel.py,tests/devices/traits/a01/test_init.py). They use the sharedfake_channel/mock_mqtt_channelfixtures and assert public behaviour: return values,values,supports()and the published payloads. The restart test also checks that the second-stage feature query still goes out ({"10000": "[244]"}). - The PR is based on 7.28.0 and merges cleanly with the current
main. - Local run on the PR head (Python 3.13):
pytest2685 passed, 11 deselected, 47 xfailed.ruff checkis clean. Localmypyreports one error intests/map/test_b01_q10_render.py:502, a file this PR does not touch; CI lint is green, so the error comes from the local environment. All CI checks are green.
This is an automated review and can be incorrect, so please reply if any finding looks wrong.
Problem
The Zeo Mini (
roborock.wm.a93) can return state and remaining time while omitting the two softener data points requested by the periodic poll. The library currently waits 10 seconds for the remaining values, then discards the values it received. This is the failure reported in #1013.Changes
If at least one requested data point arrived by the deadline, return the accumulated values and record the query as an MQTT success. The deadline is unchanged, and a query that receives none of its requested values still times out.
query_values()reports missing values asNone, and Zeo retains its known feature bits when the query omits them.Testing
321c6d5. The default suite excludes the 11 real-broker tests.