Avoid status probes during circuit discovery#1472
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR simplifies heating circuit discovery in python-bsblan by determining available circuits solely via the operating mode probe parameters, removing the previous status-parameter-based validation step to reduce setup overhead and avoid false negatives.
Changes:
- Updated
BSBLAN.get_available_circuits()to probe only operating mode parameters (no status probes). - Removed status-probe scenarios from the circuit discovery tests and added assertions that only probe parameters are queried.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/bsblan/bsblan.py | Simplifies circuit discovery to rely only on operating-mode probe params and updates logging/docstring accordingly. |
| tests/test_circuit.py | Updates and tightens tests to reflect probe-only discovery, removing status-parameter expectations. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1472 +/- ##
==========================================
- Coverage 99.89% 99.89% -0.01%
==========================================
Files 6 6
Lines 997 990 -7
Branches 135 133 -2
==========================================
- Hits 996 989 -7
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
750c935 to
a95996c
Compare
a95996c to
c5eb013
Compare
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



This pull request simplifies and streamlines the detection logic for available heating circuits in the BSBLAN integration. The main change is that circuit discovery now relies solely on the configured probe parameters (operating mode), no longer querying or interpreting status parameters. The test suite is updated to reflect this logic, removing tests and code related to status parameter checks and ensuring that only the correct probe parameters are used.
Circuit discovery logic simplification:
src/bsblan/bsblan.py: Theget_available_circuitsmethod now only uses the operating mode probe parameters (700for circuit 1,1000for circuit 2) to detect available circuits, eliminating the previous two-step check involving status parameters. This makes setup lighter and avoids false negatives when status data is unavailable. [1] [2]Test suite updates:
tests/test_circuit.py: All tests are updated to remove status parameter probes and checks. Tests now assert that only the operating mode parameters are queried, and that circuits are detected solely based on these probes. [1] [2] [3] [4] [5] [6]tests/test_circuit.py: Tests previously covering scenarios where status parameters returned inactive or empty results are removed or refactored, as these cases are no longer relevant to circuit detection. [1] [2]These changes improve reliability and maintainability by making circuit detection logic more predictable and easier to test.