Conversation
2fe84c3 to
485e8d4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1587 +/- ##
==========================================
+ Coverage 95.02% 95.07% +0.04%
==========================================
Files 159 161 +2
Lines 6234 6297 +63
Branches 353 354 +1
==========================================
+ Hits 5924 5987 +63
Misses 248 248
Partials 62 62 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
485e8d4 to
c6f5105
Compare
|
Rebased on top of Quick recap so it's easy to pick up:
Happy to address any follow-up — let me know if anything needs a tweak. |
|
|
||
| event_bus.notify( | ||
| RtkEvent( | ||
| rover_serial_number=str(observations.get("roverId", "")), |
There was a problem hiding this comment.
Do we really need all these information?
I don't know if they are useful to show
There was a problem hiding this comment.
Fair question — I don't have strong signal from the field yet on which of these get consumed vs ignored. The subset I'd argue is genuinely useful right now:
- solution_status + pose_type — the two "is the position trustworthy?" knobs. When the GOAT loses RTK lock (roverSolnSvs drops, solStat flips off 4), the mowing gets erratic. Users need to see this.
- rover_satellites_used / base_satellites_used — direct "signal quality" proxy visible in the Ecovacs Home app already.
- signal_score + occlusion_rate — degrees of the same signal question. Nice-to-have, somewhat redundant with satellites_used.
- rover_serial_number / base_station_id / base_stations[] — identifiers, mostly diagnostic.
Happy to trim to just the first two groups (solution_status/pose_type + satellites_used) if you'd rather keep the surface minimal. I lean toward keeping everything since the parsing cost is identical and downstream consumers can pick what they want, but I don't feel strongly.
Parses the cloud response of getRTK so consumers can read RTK status (rover/base satellite counts, signal scores, occlusion rates, base station SN/firmware) instead of only seeing it in the official Ecovacs Home app. Wired into the GOAT A1600 RTK (xmp9ds) capability tree as an optional CapabilityEvent on Capabilities.rtk; other devices stay unaffected (rtk defaults to None). Sample payload comes from a real GOAT A1600 RTK (firmware 1.15.13); tests cover the full payload and the no-base-station edge case.
Addresses Codecov patch coverage on this PR (was 96.83%, 2 uncovered lines flagged in deebot_client/commands/json/rtk.py per report #4413587767): - test_GetRtk_missing_observations_returns_analyse: covers the early `if not observations` return that defers to the analyse fallback when the device omits the field (RTK lock loss / early boot). - test_GetRtk_skips_non_dict_rtks_entries: covers the `if isinstance(r, dict)` filter in the `rtks` list comprehension so a stray string/None in the list doesn't drop the whole event. Full suite still green (696 tests, 11 docker deselected). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d771dbc to
3554628
Compare
|
Hi @edenhaus, gentle ping on this one 🙂
Whichever you pick, I'll push the change right away. Just flag "full" or "minimal" and I'll finalize. |
Summary
Parses the response of the existing
getRTKcloud command and notifies a newRtkEvent. The Ecovacs Home app already shows these counters under the GOAT's RTK settings screen but the library currently ignores the payload.Mapping (sample below comes from a real GOAT A1600 RTK on firmware 1.15.13):
observations.baseSolnSvs/roverSolnSvsbase_satellites_used/rover_satellites_usedrtks[0].starbase_stations[0].satellites_visibleobservations.roverSvsrover_satellites_visibleobservations.roverSignalScorerover_signal_score(0–100)Sample payload:
{ "result": 0, "rtks": [{"sn": "908276", "star": 30, "state": 0, "mode": 0, "version": "...,QD302 1.3.8,...,QD302 1.3.1"}], "observations": { "solStat": 0, "poseType": 50, "roverId": "908336", "roverSvs": 35, "roverSolnSvs": 30, "roverSignalRate": 44, "roverSignalScore": 90, "roverOcclusionRate": 8, "baseStnId": "\"1544\"", "baseSolnSvs": 29, "baseSignalRate": 45, "baseSignalScore": 94, "baseOcclusionRate": 24 } }Changes
deebot_client/events/rtk.py—RtkEvent+RtkBaseStationdataclassesdeebot_client/commands/json/rtk.py—GetRtkcommanddeebot_client/capabilities.py—Capabilities.rtk(optionalCapabilityEvent[RtkEvent])deebot_client/hardware/xmp9ds.py— wiresrtk=CapabilityEvent(RtkEvent, [GetRtk()])for the GOAT A1600 RTKtests/commands/json/test_rtk.py— full-payload + no-base-station casesOther devices stay unaffected (
rtkdefaults toNone).Test
uv run pytest tests/— 707 passed (705 existing + 2 new).