Skip to content

Fix current_runtime attribute on valve entities#395

Merged
sebr merged 1 commit intomainfrom
fix/valve-current-runtime-394
Apr 19, 2026
Merged

Fix current_runtime attribute on valve entities#395
sebr merged 1 commit intomainfrom
fix/valve-current-runtime-394

Conversation

@sebr
Copy link
Copy Markdown
Owner

@sebr sebr commented Apr 19, 2026

Summary

  • The watering_in_progress_notification WebSocket event delivers run_time at the top level and does not include a stations array. The coordinator was saving watering_status.stations as [], and the valve entity reads stations[0].run_time to populate current_runtime, so the attribute stayed null whenever watering started via a WebSocket event.
  • Synthesize a stations entry from the event's current_station and run_time so the stored shape matches the API response and current_runtime stays populated on valve entities.

Fixes #394

Test plan

  • New regression test test_handle_watering_in_progress_synthesizes_stations in tests/test_coordinator.py
  • ./scripts/test — 142 passed
  • ./scripts/lint — all checks passed

The `watering_in_progress_notification` WebSocket event delivers
`run_time` at the top level with no `stations` array. The coordinator
was storing `watering_status.stations` as an empty list, and the valve
entity reads `stations[0].run_time` to populate `current_runtime`,
leaving the attribute as null whenever watering started via a
WebSocket event.

Synthesize a stations entry from the event's `current_station` and
`run_time` so the stored shape matches the API response.

Fixes #394
@sebr sebr merged commit 927dbb9 into main Apr 19, 2026
4 checks passed
@sebr sebr deleted the fix/valve-current-runtime-394 branch April 19, 2026 03:47
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.

current_runtime not populating as valve entity attribute

1 participant