feat: add heating schedule APIs for both circuits#1460
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1460 +/- ##
=======================================
Coverage 99.89% 99.89%
=======================================
Files 6 6
Lines 955 997 +42
Branches 128 135 +7
=======================================
+ Hits 954 996 +42
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
Adds first-class heating schedule (time program) read/write support for both heating circuits in python-bsblan, including new public models, parameter mappings, client APIs, docs updates, and dedicated tests.
Changes:
- Introduces
BSBLAN.heating_schedule()(read) andBSBLAN.set_heating_schedule()(write) for circuit 1/2 time programs. - Adds new models:
HeatingSchedule(write DTO) andHeatingTimeSwitchPrograms(read response model). - Adds circuit-specific parameter-ID mappings and comprehensive tests + docs/exports.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/bsblan/bsblan.py |
Adds heating schedule read/write client methods using circuit validation and parameter mapping. |
src/bsblan/constants.py |
Adds HeatingScheduleParams mapping and an error message for missing schedule parameters. |
src/bsblan/models.py |
Adds HeatingSchedule dataclass and HeatingTimeSwitchPrograms response model. |
src/bsblan/__init__.py |
Exposes the new schedule models as part of the public API. |
tests/test_heating_schedule.py |
New tests for reading heating schedules (circuit 1/2, include filter, and error cases). |
tests/test_set_heating_schedule.py |
New tests for setting heating schedules (circuit 1/2, mapping, empty/clear behavior). |
tests/test_schedule_models.py |
Extends schedule model tests to cover HeatingSchedule. |
docs/api/models.md |
Documents the new models in the generated API docs. |
docs/api/client.md |
Documents the new client methods in the generated API docs. |
|
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 comprehensive support for reading and setting heating schedules for BSB-LAN devices, including new data models, API methods, constants, and extensive tests. The changes introduce
heating_scheduleandset_heating_schedulemethods, new models for handling heating time switch programs, and validation/error handling for these features. Documentation and test coverage are updated to reflect and verify the new functionality.API and Model Additions:
heating_scheduleandset_heating_scheduletobsblan.pyfor retrieving and updating heating time switch programs per circuit, with input validation and error handling.HeatingScheduledataclass for representing weekly heating schedules and theHeatingTimeSwitchProgramsmodel for API responses. [1] [2]__init__.pyto export the new models for public use. [1] [2]Constants and Validation:
HeatingScheduleParamstoconstants.py, mapping parameter IDs for each heating circuit, and introduced a new error message for missing heating schedule parameters. [1] [2]Documentation Updates:
heating_schedule,set_heating_schedule,HeatingTimeSwitchPrograms,HeatingSchedule). [1] [2] [3]Testing:
heating_scheduleandset_heating_schedule, covering correct parameter mapping, error cases, and model behavior. Also updated model tests to coverHeatingSchedule. [1] [2] [3] [4]