Fix Vision border-cut: build mz payload from cached zones (keep zones/topology)#393
Open
ascha191 wants to merge 1 commit into
Open
Fix Vision border-cut: build mz payload from cached zones (keep zones/topology)#393ascha191 wants to merge 1 commit into
ascha191 wants to merge 1 commit into
Conversation
Border-cut on Vision (protocol 1) mowers is a per-zone setting (cfg.mz.s[*].cfg.cut) and the zone topology lives in cfg.mz.p. The previous mz form sent a single hard-coded zone with an empty p, which made the mower drop the other zones and the beacon mapping (MTrab/landroid_cloud#1289). PR MTrab#390 switched to the top-level {"cut":...} form, but Vision models ignore it, so border-cut stopped applying. Build the command from the mower's cached cfg.mz, changing only the cut values and keeping s (all zones) and p (topology) intact. Fall back to the top-level cut form when no multizone config is cached. Verified on physical hardware (WR206E Vision, 2 zones): border-cut applied, both zones and topology preserved. Refs MTrab/landroid_cloud#1289, MTrab/landroid_cloud#876 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Border-cut on Vision (protocol 1) mowers is a per-zone setting (
cfg.mz.s[*].cfg.cut), and the zone topology lives separately incfg.mz.p. The previousmzform sent a single hard-coded zone with an emptyp, which the mower interprets as "these are all the zones" → it drops the other zones and the beacon mapping (MTrab/landroid_cloud#1289). #390 worked around that by sending the top-level{"cut":...}form, but Vision models silently ignore it, so border-cut no longer applies.This builds the command from the mower's cached
cfg.mz(read-modify-write): it changes only thecutvalues and keepss(all zones) andp(topology) intact. When no multizone config is cached it falls back to the top-level{"cut":...}form, so existing behaviour is unchanged.Test strategy
ruff format/ruff check— cleanpytest tests/test_api_lifecycle.py— 65 passedcfg.mz→ fallback path)test_border_cut_settings_preserves_zones_via_mz: with a cached two-zonecfg.mz, asserts the published payload is{"mz":...}with both zones present,punchanged, onlycutupdated, and the cache not mutated in placep:[]payload reproduced the zone deletion; re-sending the originalmzrestored both zones.Open question
The service has no zone parameter, so this applies the same
ob/bdto all zones. Is that the intended behaviour, or should it target only the active zone? Happy to adjust.Known limitations
No change for non-multizone devices (fallback path). The local
cfg.mzcache is not mirrored after sending; it is corrected by the next mower status.Required configuration changes
None.
Semver
patch
Refs MTrab/landroid_cloud#1289, MTrab/landroid_cloud#876