Conversation
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.
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.
Summary
BHyveSmartWateringSwitchfor devices with smart watering support, created from device/zone data rather than the programs APIsmart_watering_enabledfield via the device APIsmart_watering_enabledwhen smart program create/destroy websocket events are receivedwatering_planfrom websocket debug logs to reduce noiseBHyveProgramSwitchcreationTest plan