Add minimal PPS climate support#1483
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 1086 +96
Branches 133 146 +13
=======================================
+ Hits 989 1085 +96
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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. |
|



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.