Skip to content

Improve circuit operating mode validation for None and invalid values#1533

Merged
liudger merged 2 commits into
mainfrom
bugfix/fix-probe-valid-params
Jun 14, 2026
Merged

Improve circuit operating mode validation for None and invalid values#1533
liudger merged 2 commits into
mainfrom
bugfix/fix-probe-valid-params

Conversation

@liudger

@liudger liudger commented Jun 14, 2026

Copy link
Copy Markdown
Owner

This pull request improves the validation logic for determining available circuits by ensuring that circuits with invalid or missing operating mode values are correctly excluded. The changes enhance reliability by explicitly checking for invalid values, not just missing data.

Validation improvements for circuit availability:

  • Updated get_available_circuits in bsblan.py to exclude circuits whose operating mode value is None or "---", in addition to empty or missing data.
  • Updated _get_available_pps_circuits in bsblan.py to check for invalid operating mode values (None or "---") and handle them by clearing available circuits and returning an empty list.

Copilot AI review requested due to automatic review settings June 14, 2026 08:21
@liudger liudger added the bugfix Inconsistencies or issues which will cause a problem for users or implementers. label Jun 14, 2026
@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b356a1d) to head (54730bc).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1533   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         1227      1233    +6     
  Branches       140       141    +1     
=========================================
+ Hits          1227      1233    +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request tightens circuit discovery in the main BSBLAN client by treating missing/placeholder operating-mode values as “unsupported”, improving reliability of get_available_circuits() across devices that return None or "---".

Changes:

  • Updated get_available_circuits() to exclude circuits when the operating mode payload is missing/empty or the returned value is None/"---".
  • Updated PPS circuit discovery (_get_available_pps_circuits()) to also reject None/"---" operating-mode values and clear the cached available-circuits set.

Comment thread src/bsblan/bsblan.py
Comment thread src/bsblan/bsblan.py
@sonarqubecloud

Copy link
Copy Markdown

@liudger liudger merged commit 9edaee9 into main Jun 14, 2026
16 checks passed
@liudger liudger deleted the bugfix/fix-probe-valid-params branch June 14, 2026 08:28
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bugfix Inconsistencies or issues which will cause a problem for users or implementers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants