Skip to content

feat: add optional position capability for mowers#1588

Open
Beennnn wants to merge 1 commit into
DeebotUniverse:devfrom
Beennnn:feat/position-capability-mowers
Open

feat: add optional position capability for mowers#1588
Beennnn wants to merge 1 commit into
DeebotUniverse:devfrom
Beennnn:feat/position-capability-mowers

Conversation

@Beennnn
Copy link
Copy Markdown
Contributor

@Beennnn Beennnn commented May 9, 2026

Summary

Adds `Capabilities.position` as an optional `CapabilityEvent[PositionsEvent]` so devices that don't expose the full map capability (e.g. mowers like the Ecovacs GOAT family) can still report their position to consumers.

Today `PositionsEvent` is only fired through `CapabilityMap.position`, but mowers don't have a `map` capability, so the event never reaches subscribers even though `getPos` works fine on the device. Adding a top-level optional `position` capability lets mowers wire `GetPos` directly without forcing a fake `map` capability.

Changes

  • `deebot_client/capabilities.py` — `Capabilities.position: CapabilityEvent[PositionsEvent] | None = None`
  • `deebot_client/hardware/xmp9ds.py` — wires `position=CapabilityEvent(PositionsEvent, [GetPos()])` on the GOAT A1600 RTK

Other devices stay unaffected (`position` defaults to `None`; vacuums keep using `CapabilityMap.position`).

Test

`uv run pytest tests/` — 703 passed.

Adds Capabilities.position as an optional CapabilityEvent[PositionsEvent]
so devices that don't expose the full map capability (e.g. mowers like
the Ecovacs GOAT family) can still report their position to consumers.

Wired into the GOAT A1600 RTK (xmp9ds) using GetPos. Other devices stay
unaffected (position defaults to None; vacuums keep using
CapabilityMap.position).
@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.00%. Comparing base (f87b6c9) to head (436f3fc).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #1588   +/-   ##
=======================================
  Coverage   94.99%   95.00%           
=======================================
  Files         158      158           
  Lines        6199     6201    +2     
  Branches      353      353           
=======================================
+ Hits         5889     5891    +2     
  Misses        248      248           
  Partials       62       62           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 9, 2026

Merging this PR will not alter performance

✅ 113 untouched benchmarks


Comparing Beennnn:feat/position-capability-mowers (436f3fc) with dev (f87b6c9)

Open in CodSpeed

Beennnn added a commit to Beennnn/core that referenced this pull request May 14, 2026
`async_register_platform_entity_service` only supports one `entity_domain`
per call — registering twice with the same service name silently overrode
the vacuum handler, breaking the existing service.

Split into two distinct service names:
- `ecovacs.raw_get_positions` (vacuums, unchanged, backward-compatible)
- `ecovacs.mower_raw_get_positions` (lawn mowers, new)

The mower handler still raises `ServiceValidationError` until the optional
position capability for mowers lands in deebot-client (see
DeebotUniverse/client.py#1588). The test now reflects that user-facing
behaviour and will be updated once the lib bump happens.

Addresses CI 'Run tests Python 3.14.4 (ecovacs)' fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant