Conversation
Add mowed area to StatsEvent
Parse mowedArea from onStats
Test mowedArea parsing
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1771 +/- ##
==========================================
+ Coverage 96.26% 96.31% +0.04%
==========================================
Files 161 161
Lines 6399 6401 +2
Branches 368 368
==========================================
+ Hits 6160 6165 +5
+ Misses 172 169 -3
Partials 67 67 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Downstream Home Assistant implementation is now available as a draft PR for visibility and dependency tracking: home-assistant/core#180054 It intentionally remains in draft until this PR is merged and included in a published |
| @@ -30,6 +30,7 @@ def _handle_body_data_dict( | |||
| area=data.get("area"), | |||
There was a problem hiding this comment.
| area=data.get("area"), | |
| area=data.get("area", data.get("mowedArea")), |
I expect area is not there if mowedArea is there. So this one would be just falling back the mowedArea when area is not available
There was a problem hiding this comment.
On the O1200 both fields are present in the same onStats payload. In the capture used for this PR, area=492475 is the planned total area, while mowedArea=28699 is the area completed so far. So mowedArea is not a fallback for area on this device; they represent different values. That's why I kept them separate. I can add the captured payload shape to the test if that would make the distinction clearer.
Summary
Add support for mowing job progress statistics reported by GOAT mowers, with the behavior enabled explicitly for the GOAT O1200 LiDAR (
2i0fns).For the O1200, observed stats semantics are:
area: planned total mowing areamowedArea: area mowed so fartime: estimated total mowing durationThis change preserves compatibility for existing devices while exposing the additional data needed by consumers to calculate mowing progress.
Changes
StatsEvent.mowed_areamowedAreafromonStatsmowedAreafromGetStatsCapabilityStats.mowing_job_progress, defaulting toFalsemowing_job_progressonly for hardware class2i0fns5xu9h3on their current stats semanticsConsumers can derive progress for devices with
mowing_job_progress=Trueas:mowed_area / area * 100Verification
Observed on a GOAT O1200 LiDAR during a mowing job:
area=492475-> 49.2475 m² planned areamowedArea=28699-> 2.8699 m² mowedtime=2304-> 38m24s estimated total mowing durationRelevant stats and hardware tests pass locally.