fix(addon): fail-low daily-volume fallback so orphaned zones can't free-run to 300 L#13
Draft
JakeTheRabbit wants to merge 1 commit into
Draft
fix(addon): fail-low daily-volume fallback so orphaned zones can't free-run to 300 L#13JakeTheRabbit wants to merge 1 commit into
JakeTheRabbit wants to merge 1 commit into
Conversation
…ee-run to 300 L Zones the engine detects from their VWC sensor but that the integration never built a max_daily_volume entity for (num_zones < detected zones) fell through to a hardcoded 300 L fallback — above the integration's own 200 L UI maximum — so orphaned rows watered up to 300 L/day while wired rows honoured their real cap. Lower the fallback to 150 L so a missing cap entity can never grant more daily water than the UI can express. Co-Authored-By: Claude <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.
Why
Two rows were watering to 300 L/day while a third capped at ~100 L. Nobody chose 300 — it's a hardcoded engine fallback, and the split exposed a real bug.
Root cause — zone-count mismatch between the two layers:
range(1, num_zones + 1), andnum_zonesdefaults to 1 (number.py:643). So it createsnumber.crop_steering_zone_1_max_daily_volumeand nothing for zones 2/3._detect_zones(controller.py:467) probes for VWC sensors and runs P0→P3 for every physical zone it finds (3 here)._zone_num(..., "max_daily_volume", 300)fell through to the hardcoded 300 L failsafe — above the integration's own 200 L UI maximum. Wired zone 1 honoured its real 100 L cap; orphaned zones 2/3 free-ran to 300.What
Lower the engine's
max_daily_volumefallback from 300 → 150 L so a missing/unavailable cap entity can never grant more daily water than the UI can even express (200 L max). This directly caps the orphaned rows.Notes / follow-up
🤖 Generated with Claude Code
Generated by Claude Code