Skip to content

Separate transport and status availability - #2

Draft
mel9320107 wants to merge 7 commits into
mainfrom
agent/separate-transport-status-availability
Draft

Separate transport and status availability#2
mel9320107 wants to merge 7 commits into
mainfrom
agent/separate-transport-status-availability

Conversation

@mel9320107

Copy link
Copy Markdown
Owner

What changed

  • Track valid transport traffic separately from fresh spa status frames.
  • Expire status availability after 10 seconds without a regular status update, even if other RS-485 traffic continues.
  • Prevent state-derived entities and commands from relying on retained stale spa state.
  • Keep state-independent diagnostic requests available while transport traffic remains healthy.
  • Expose distinct transport/status timestamps and availability in diagnostics.
  • Add focused tests for transport-only traffic, status freshness expiry, and disconnect behaviour.

Why

Previously, any recognised protocol frame refreshed the integration's single availability flag. Bus-management or configuration traffic could therefore make an old SpaState appear current after a reconnect or after regular status frames stopped arriving.

Validation

  • python -m unittest -q tests.test_client_availability — 3 tests passed.
  • python -m compileall -q custom_components/spa_pool tests — passed.
  • Remote comparison confirms this branch is based directly on main and changes only the six integration files plus the focused test file.

Hardware testing requested

Please install this draft branch in Home Assistant and verify normal entity availability, command behaviour, and recovery after temporarily interrupting spa status traffic or the TCP connection.

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