Add minimal PPS climate support#1483
Open
liudger wants to merge 3 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1483 +/- ##
=======================================
Coverage 99.89% 99.90%
=======================================
Files 6 6
Lines 990 1080 +90
Branches 133 144 +11
=======================================
+ Hits 989 1079 +90
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds minimal PPS bus “climate circuit” support to the python-bsblan async client by introducing PPS-specific parameter mappings, state normalization, and feature-gating based on cached /JI device metadata (bus type, write support, and time sync capability).
Changes:
- Added PPS-specific API parameter maps (15000+ range) and HVAC-mode translation tables for PPS devices.
- Cached device metadata in the client and used it to gate time sync and PPS write operations, plus normalized PPS HVAC mode values into the library’s
Statemodel. - Added comprehensive PPS-focused tests and updated the control example to display bus metadata and skip unsupported time sync.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/bsblan/constants.py |
Adds PPS parameter maps and PPS HVAC mode translation constants; introduces new error messages. |
src/bsblan/models.py |
Extends Device model with bus metadata fields and capability helper properties. |
src/bsblan/bsblan.py |
Applies PPS-specific API config, caches device metadata, gates time sync/writes, and normalizes PPS state values. |
examples/control.py |
Prints bus metadata and conditionally performs time sync only when supported. |
tests/test_pps.py |
New test suite validating PPS behavior (param mapping, mode translation, time sync gating, circuit handling). |
tests/test_time.py |
Seeds cached device metadata so time tests don’t trigger new /JI metadata fetch behavior. |
tests/test_device.py |
Asserts new bus metadata fields and derived time sync capability. |
tests/fixtures/pps_device.json |
PPS device metadata fixture. |
tests/fixtures/pps_state.json |
PPS “climate” state fixture for 15000+ params. |
tests/fixtures/pps_static_values.json |
PPS static value bounds fixture. |
Comment on lines
503
to
506
| logger.warning( | ||
| "Could not find parameter 710 in heating section response. " | ||
| "Could not find target temperature in heating section response. " | ||
| "Using default temperature unit (°C)" | ||
| ) |
Comment on lines
+533
to
+535
| """Return whether the normal BSB/LPB time sync command is safe.""" | ||
| return self._device is None or self._device.supports_time_sync | ||
|
|
Comment on lines
1189
to
1194
| if hvac_mode is not None: | ||
| self._validate_hvac_mode(hvac_mode) | ||
| hvac_value = str(hvac_mode) | ||
| if self._uses_pps_bus: | ||
| hvac_value = Validation.PPS_HVAC_MODE_TO_BSBLAN[hvac_mode] | ||
| state.update( |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 adds robust support for PPS bus devices in the BSBLAN library and its control example. The changes introduce new parameter mappings, validation logic, and state normalization for PPS bus compatibility, while ensuring that device metadata is used to control feature availability (such as time sync and writable bus checks). The control example is updated to display new bus metadata and to handle PPS-specific limitations gracefully.
PPS Bus Support and Parameter Mapping:
PPS_HEATING_PARAMSandPPS_STATIC_VALUES_PARAMSto map PPS bus parameters, and updated the API config to use these when a PPS bus is detected (src/bsblan/constants.py,src/bsblan/bsblan.py). [1] [2] [3]src/bsblan/bsblan.py). [1] [2]Validation and State Handling Improvements:
src/bsblan/bsblan.py). [1] [2]src/bsblan/constants.py,src/bsblan/bsblan.py). [1] [2] [3]Device Metadata and Feature Gating:
src/bsblan/bsblan.py). [1] [2] [3] [4]Control Example Enhancements:
examples/control.py). [1] [2] [3] [4] [5]General Refactoring and Robustness:
src/bsblan/bsblan.py). [1] [2] [3] [4] [5]These changes collectively enable seamless support for PPS bus devices, improve feature safety, and enhance the user experience in both the library and example code.