Skip to content

feat: add heating schedule APIs for both circuits#1460

Merged
liudger merged 3 commits intomainfrom
feat/heating-schedule
Apr 23, 2026
Merged

feat: add heating schedule APIs for both circuits#1460
liudger merged 3 commits intomainfrom
feat/heating-schedule

Conversation

@liudger
Copy link
Copy Markdown
Owner

@liudger liudger commented Apr 23, 2026

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_schedule and set_heating_schedule methods, 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:

  • Added new API methods heating_schedule and set_heating_schedule to bsblan.py for retrieving and updating heating time switch programs per circuit, with input validation and error handling.
  • Introduced the HeatingSchedule dataclass for representing weekly heating schedules and the HeatingTimeSwitchPrograms model for API responses. [1] [2]
  • Updated __init__.py to export the new models for public use. [1] [2]

Constants and Validation:

  • Added HeatingScheduleParams to constants.py, mapping parameter IDs for each heating circuit, and introduced a new error message for missing heating schedule parameters. [1] [2]

Documentation Updates:

  • Updated API and model documentation to include the new methods and models (heating_schedule, set_heating_schedule, HeatingTimeSwitchPrograms, HeatingSchedule). [1] [2] [3]

Testing:

  • Added new test suites for heating_schedule and set_heating_schedule, covering correct parameter mapping, error cases, and model behavior. Also updated model tests to cover HeatingSchedule. [1] [2] [3] [4]

Copilot AI review requested due to automatic review settings April 23, 2026 09:34
@liudger liudger added the new-feature New features or options. label Apr 23, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.89%. Comparing base (fd942d1) to head (913e062).
⚠️ Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and BSBLAN.set_heating_schedule() (write) for circuit 1/2 time programs.
  • Adds new models: HeatingSchedule (write DTO) and HeatingTimeSwitchPrograms (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.

@liudger liudger added the refactor Improvement of existing code, not introducing new features. label Apr 23, 2026
@sonarqubecloud
Copy link
Copy Markdown

@liudger liudger merged commit 91910b9 into main Apr 23, 2026
17 checks passed
@liudger liudger deleted the feat/heating-schedule branch April 23, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature New features or options. refactor Improvement of existing code, not introducing new features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants