Rename API config profiles to API_FULL/API_BASIC#1526
Conversation
…stants
- Rename API_V3 -> API_FULL and API_V2 -> API_BASIC across src and tests
- Refactor build_api_config to a keyword-only full flag and drop the
SUPPORTED_API_VERSIONS membership check / ValueError path
- Remove SUPPORTED_API_VERSION(S) and BASIC_API_VERSION constants
- Rename ErrorMsg.API_VERSION -> CONFIG_NOT_RESOLVED
("API configuration not resolved")
- Update tests and stale v2/v3 comments to capability-based wording
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1526 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 1230 1223 -7
Branches 140 139 -1
=========================================
- Hits 1230 1223 -7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
There was a problem hiding this comment.
Pull request overview
This pull request refactors how the library represents and selects its API configuration profile by replacing version-number naming (API_V2/API_V3) with clearer profile naming (API_BASIC/API_FULL), and by aligning related error messaging and tests to the new terminology.
Changes:
- Renamed API configuration constants across the codebase and tests to
API_BASIC/API_FULL. - Simplified API config construction by switching
build_api_configfrom version strings to afull: boolkeyword argument. - Updated error messaging for the “capability/config not resolved” defensive paths and adjusted tests accordingly.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/bsblan/constants.py |
Introduces API_BASIC/API_FULL, updates build_api_config(full=...), and renames related error message constants. |
src/bsblan/bsblan.py |
Switches client config-copy logic and defensive errors to the new config naming and messages. |
src/bsblan/_version.py |
Updates JSON-API threshold constant usage and constructor naming for capability resolution. |
tests/conftest.py |
Updates shared fixture setup to use API_FULL. |
tests/test_api_initialization.py |
Aligns initialization assertions and error expectations to API_FULL and the new error message. |
tests/test_api_validation.py |
Updates validation tests to reference API_FULL instead of legacy naming. |
tests/test_circuit.py |
Updates circuit tests to use the new default build_api_config() interface. |
tests/test_constants.py |
Updates constants/build config tests for API_BASIC/API_FULL and build_api_config(full=...). |
tests/test_hot_water_additional.py |
Updates hot water tests to use API_FULL and the updated “config not resolved” wording. |
tests/test_hotwater_state.py |
Refactors hot water state test config construction to use API_FULL. |
tests/test_include_parameter.py |
Updates include-parameter tests to use API_FULL and adjusted validator setup. |
tests/test_initialization.py |
Updates defensive-path error expectations to the new CONFIG_NOT_RESOLVED message. |
tests/test_pps.py |
Updates PPS setup to use the new default build_api_config() interface. |
tests/test_read_parameters.py |
Updates parameter-reading tests to use API_FULL. |
tests/test_sensor.py |
Renames sensor test fixtures/constants to API_FULL naming. |
tests/test_state.py |
Updates state tests to use API_FULL and updates copied-config construction accordingly. |
tests/test_static_state.py |
Updates static state tests to use API_FULL. |
tests/test_temperature_validation.py |
Updates temperature validation tests to use API_FULL. |
tests/test_utility_edge_cases.py |
Updates API validator edge-case tests to use API_FULL. |
tests/test_version_errors.py |
Updates version/config defensive-path test to assert the new CONFIG_NOT_RESOLVED error message. |
| # is rejected, the [MIN_SUPPORTED_JSON_API, V3_JSON_API_MINIMUM) range selects | ||
| # the basic single-circuit config, and a version >= V3_JSON_API_MINIMUM selects |
| json_api_minimum: str = MIN_SUPPORTED_JSON_API, | ||
| json_api_v3_minimum: str = V3_JSON_API_MINIMUM, | ||
| json_api_v2_minimum: str = V2_JSON_API_MINIMUM, | ||
| ) -> None: |



This pull request refactors the API configuration versioning system in the
bsblanproject to use clearer, more descriptive identifiers (API_BASIC,API_FULL) instead of version numbers (API_V2,API_V3). It also updates error messages for better clarity and simplifies the API configuration building logic. All usages in the codebase and tests are updated accordingly.API configuration refactor:
Replaces
API_V2/API_V3constants and terminology withAPI_BASIC/API_FULLthroughout the codebase and tests for improved clarity. (src/bsblan/constants.py,src/bsblan/bsblan.py,tests/conftest.py,tests/test_api_initialization.py,tests/test_api_validation.py,tests/test_circuit.py,tests/test_constants.py,tests/test_hot_water_additional.py) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26]Refactors the
build_api_configfunction to use afull: boolparameter instead of version strings, removing support for version-based configuration selection and simplifying its interface. (src/bsblan/constants.py)Error handling improvements:
"API version not set"with"API configuration not resolved". (src/bsblan/constants.py,src/bsblan/bsblan.py,tests/test_api_initialization.py) [1] [2] [3]Documentation and comments:
src/bsblan/constants.py) [1] [2]Test updates:
API_BASIC/API_FULLconstants and the updatedbuild_api_configinterface, ensuring consistency and removing version-based test logic. (tests/conftest.py,tests/test_api_initialization.py,tests/test_api_validation.py,tests/test_circuit.py,tests/test_constants.py,tests/test_hot_water_additional.py) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22]These changes make the API configuration system more maintainable and easier to understand, and improve the clarity of error handling and documentation.