Skip to content

Smart watering switch and program improvements#378

Merged
sebr merged 6 commits intomainfrom
program-fixes
Apr 9, 2026
Merged

Smart watering switch and program improvements#378
sebr merged 6 commits intomainfrom
program-fixes

Conversation

@sebr
Copy link
Copy Markdown
Owner

@sebr sebr commented Apr 8, 2026

Summary

  • Add per-zone BHyveSmartWateringSwitch for devices with smart watering support, created from device/zone data rather than the programs API
  • Smart watering on/off patches the zone's smart_watering_enabled field via the device API
  • Coordinator syncs zone smart_watering_enabled when smart program create/destroy websocket events are received
  • Smart program "destroy" events keep the entity (not deleted) since they represent a toggle, not a removal
  • Non-smart program updates now only send the required API keys
  • Strip watering_plan from websocket debug logs to reduce noise
  • Skip smart programs in regular BHyveProgramSwitch creation

Test plan

  • All 117 tests pass, 5 skipped
  • Linting passes
  • Verify smart watering switch toggles correctly for single-zone devices
  • Verify smart watering switch toggles correctly for multi-zone devices
  • Verify state syncs when toggled from B-hyve app

sebr added 5 commits April 8, 2026 21:28
Smart programs are controlled via the device's water_sense_mode setting
("auto" for on, "off" for off) rather than the program update API.
Non-smart programs continue using update_program as before.

Also adds update_device method to the BHyve API client.
- Create per-zone BHyveSmartWateringSwitch instead of one per device,
  with zone-specific names for multi-zone devices
- Smart program "destroy" websocket events keep the entity instead of
  deleting it (water_sense_mode toggled off, not truly deleted)
- is_on reads zone-level smart_watering_enabled
- Strip watering_plan from websocket debug logs to reduce noise
- Skip smart programs in regular program switch creation
When a smart program is destroyed (turned off via app), update all
zones on the device to smart_watering_enabled=false so the smart
watering switches reflect the correct state. Similarly, set to true
when a smart program is created (turned on).
The smart watering on/off is controlled per-zone via the zone's
smart_watering_enabled field on the device, not via the device-level
water_sense_mode. Send the full zones array with the target zone's
smart_watering_enabled toggled, leaving other zones unchanged.
@sebr sebr changed the title Use water_sense_mode device API for smart program on/off Smart watering switch and program improvements Apr 9, 2026
@sebr sebr merged commit 35e7790 into main Apr 9, 2026
4 checks passed
@sebr sebr deleted the program-fixes branch April 9, 2026 02:11
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