Refactor circuit discovery logic, enhance parameter validation#1552
Conversation
liudger
commented
Jul 4, 2026
- Replace MIN_SUPPORTED_JSON_API check with _supports_full_config in BSBLAN class.
- Introduce is_param_value_active utility function to streamline active value checks.
- Update tests to cover new logic for circuit discovery and parameter validation.
- Replace MIN_SUPPORTED_JSON_API check with _supports_full_config in BSBLAN class. - Introduce is_param_value_active utility function to streamline active value checks. - Update tests to cover new logic for circuit discovery and parameter validation.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1552 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 14 14
Lines 1325 1325
Branches 142 142
=========================================
Hits 1325 1325 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
There was a problem hiding this comment.
Pull request overview
This PR refactors heating-circuit discovery in the BSBLAN client to rely on the resolved capability flag (basic vs full config) rather than a JSON-API version string, and centralizes the “active parameter value” check so circuit probing and API section validation cannot diverge.
Changes:
- Replace the circuit-discovery short-circuit guard with
self._supports_full_config is False(basic-config detection). - Introduce
is_param_value_active()insrc/bsblan/utility.pyand reuse it inAPIValidatorand both circuit-probing paths. - Extend tests to cover basic-config skip behavior and unresolved-capability probing, plus direct coverage of the new helper.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/bsblan/bsblan.py |
Uses _supports_full_config is False to skip discovery for basic config; reuses shared active-value predicate in probing logic. |
src/bsblan/utility.py |
Adds is_param_value_active() and delegates APIValidator._is_valid_param() to it. |
tests/test_circuit.py |
Updates/extends circuit discovery tests for basic-config skip and unresolved-capability probing. |
tests/test_utility.py |
Adds direct unit tests for is_param_value_active() and keeps validator tests green via delegation. |
openspec/specs/circuit-discovery/spec.md |
Adds spec documenting circuit discovery guard behavior and the shared predicate. |
openspec/changes/archive/2026-07-04-harden-circuit-discovery-consistency/tasks.md |
Archives implementation tasks/checklist for the change. |
openspec/changes/archive/2026-07-04-harden-circuit-discovery-consistency/specs/circuit-discovery/spec.md |
Archives delta spec for the circuit-discovery requirements. |
openspec/changes/archive/2026-07-04-harden-circuit-discovery-consistency/proposal.md |
Archives proposal context and intended behavior changes. |
openspec/changes/archive/2026-07-04-harden-circuit-discovery-consistency/design.md |
Archives design rationale and trade-offs for the refactor/guard change. |
openspec/changes/archive/2026-07-04-harden-circuit-discovery-consistency/.openspec.yaml |
Archives OpenSpec metadata for the change bundle. |
| Returns: | ||
| bool: True if the payload is non-empty and its value is neither | ||
| None nor the inactive marker ("---"). | ||
|
|


