Skip to content

Support enable/disable_rain_delay services on rain delay switch#408

Merged
sebr merged 1 commit intomainfrom
claude/fix-issue-407-k7Rcb
Apr 23, 2026
Merged

Support enable/disable_rain_delay services on rain delay switch#408
sebr merged 1 commit intomainfrom
claude/fix-issue-407-k7Rcb

Conversation

@sebr
Copy link
Copy Markdown
Owner

@sebr sebr commented Apr 23, 2026

Summary

Fixes #407.

bhyve.enable_rain_delay / bhyve.disable_rain_delay are registered by the valve platform, and since #391 the service handler routes calls through both VALVE_DOMAIN and SWITCH_DOMAIN — but the corresponding methods were only ported onto BHyveZoneValve. Calling bhyve.enable_rain_delay with a rain-delay switch entity (the natural target) therefore logged Service enable_rain_delay is not supported by entity switch.<device>_rain_delay and the requested hours were silently dropped.

  • Add enable_rain_delay(hours: int = 24) and disable_rain_delay() to BHyveRainDelaySwitch, delegating to coordinator.client.set_rain_delay.
  • Route async_turn_on / async_turn_off through these methods so there's one path to the client.
  • Add regression tests covering both service methods with custom hours and the zero-hour disable.

Test plan

  • ./scripts/lint
  • pytest tests/ — 155 passed, 5 skipped (new test_rain_delay_switch_enable_rain_delay / test_rain_delay_switch_disable_rain_delay pass)

Generated by Claude Code

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
@sebr sebr marked this pull request as ready for review April 23, 2026 12:53
@sebr sebr merged commit 5752240 into main Apr 23, 2026
4 checks passed
@sebr sebr deleted the claude/fix-issue-407-k7Rcb branch April 23, 2026 12:54
@sebr sebr mentioned this pull request Apr 23, 2026
1 task
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.

Enable and Disable Rain delay service not working

2 participants