Support enable/disable_rain_delay services on rain delay switch#408
Merged
Support enable/disable_rain_delay services on rain delay switch#408
Conversation
The valve service handler routes service calls through both VALVE_DOMAIN and SWITCH_DOMAIN, but only BHyveZoneValve implemented enable_rain_delay and disable_rain_delay. Calling bhyve.enable_rain_delay with a rain delay switch entity logged "Service is not supported by entity" and the requested hours were never applied. Add matching methods to BHyveRainDelaySwitch so the service resolves on the natural target entity, and delegate async_turn_on/off through them to keep a single path to the client. Fixes #407
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
Fixes #407.
bhyve.enable_rain_delay/bhyve.disable_rain_delayare registered by the valve platform, and since #391 the service handler routes calls through bothVALVE_DOMAINandSWITCH_DOMAIN— but the corresponding methods were only ported ontoBHyveZoneValve. Callingbhyve.enable_rain_delaywith a rain-delay switch entity (the natural target) therefore loggedService enable_rain_delay is not supported by entity switch.<device>_rain_delayand the requested hours were silently dropped.enable_rain_delay(hours: int = 24)anddisable_rain_delay()toBHyveRainDelaySwitch, delegating tocoordinator.client.set_rain_delay.async_turn_on/async_turn_offthrough these methods so there's one path to the client.Test plan
./scripts/lintpytest tests/— 155 passed, 5 skipped (newtest_rain_delay_switch_enable_rain_delay/test_rain_delay_switch_disable_rain_delaypass)Generated by Claude Code