Improve circuit operating mode validation for None and invalid values#1533
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
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 returnedvalueisNone/"---". - Updated PPS circuit discovery (
_get_available_pps_circuits()) to also rejectNone/"---"operating-mode values and clear the cached available-circuits set.
|
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 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:
get_available_circuitsinbsblan.pyto exclude circuits whose operating mode value isNoneor"---", in addition to empty or missing data._get_available_pps_circuitsinbsblan.pyto check for invalid operating mode values (Noneor"---") and handle them by clearing available circuits and returning an empty list.