Skip to content

feat(commands): Add SetAreaParameter command for mower zone control - #1627

Open
monsivar wants to merge 16 commits into
DeebotUniverse:devfrom
monsivar:feature-set-area-command
Open

feat(commands): Add SetAreaParameter command for mower zone control#1627
monsivar wants to merge 16 commits into
DeebotUniverse:devfrom
monsivar:feature-set-area-command

Conversation

@monsivar

@monsivar monsivar commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Add the SetAreaParameter JSON command for controlling zone-specific mower parameters.

This command was identified by capturing the MQTT communication between the Ecovacs app and my GOAT O1200 LiDAR Pro.

Related to #1610.

Command

The mower accepts the following command:

setAreaParameter

The outgoing payload uses a flat structure under body.data:

{
  "areaID": "2",
  "mowHeightLevel": 10,
  "cutMode": 7,
  "obstacleHeight": 1,
  "angle": 136
}

The areaParameters list is used by the device's subsequent onAreaParameter status report, but it is not part of the outgoing setAreaParameter command.

Changes

  • Add SetAreaParameter under deebot_client.commands.json.
  • Register the command in the JSON command registry.
  • Export the command from deebot_client.commands.json.
  • Add tests for the default values.
  • Add tests for custom values.

Parameters

  • area_id: ID of the mower area.
  • angle: mowing direction in degrees.
  • mow_height_level: mower height level.
  • cut_mode: cutting mode, defaulting to 7.
  • obstacle_height: obstacle-height setting, defaulting to 1.

Verification

The payload structure was captured from the Ecovacs app and successfully used with my GOAT O1200 LiDAR Pro.

This PR only adds the command implementation and tests. It does not yet add a higher-level capability or expose the command through Home Assistant.

monsivar added 4 commits June 2, 2026 11:34
Added `WEED_ROPE` ("weedRope") and `TRIMMER_BRUSH` ("trimmerBrush")
feat(events): add weedRope and trimmerBrush to LifeSpan enum
feat(commands): add SetAreaParameter command for mowers
feat(commands): register SetAreaParameter command
Comment thread deebot_client/events/__init__.py Outdated
Comment thread deebot_client/messages/json/area_parameter.py Outdated
@monsivar
monsivar marked this pull request as draft July 3, 2026 14:48
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.08%. Comparing base (2a7b432) to head (8804e57).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #1627   +/-   ##
=======================================
  Coverage   95.08%   95.08%           
=======================================
  Files         161      162    +1     
  Lines        6301     6308    +7     
  Branches      354      354           
=======================================
+ Hits         5991     5998    +7     
  Misses        248      248           
  Partials       62       62           

☔ View full report in Codecov by Harness.
📢 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.

Add tests for SetAreaParameter command with default and custom values.
@codspeed-hq

codspeed-hq Bot commented Jul 3, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 226 untouched benchmarks


Comparing monsivar:feature-set-area-command (8804e57) with dev (2a7b432)

Open in CodSpeed

@monsivar
monsivar marked this pull request as ready for review July 3, 2026 16:09
@monsivar

monsivar commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

I have addressed the requested changes:

removed the unrelated lifespan and hardware changes;
moved SetAreaParameter to the commands module;
registered it in the JSON command registry;
corrected the outgoing payload to use the flat body.data structure observed in the MQTT capture;
added tests for default and custom values.

All checks are now passing. The PR should be ready for another review. Thank you for the guidance.

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.

2 participants