Skip to content

Comments

Add TIMEPROG data type#1363

Merged
liudger merged 3 commits intomainfrom
fix-dhw-shedule
Feb 23, 2026
Merged

Add TIMEPROG data type#1363
liudger merged 3 commits intomainfrom
fix-dhw-shedule

Conversation

@liudger
Copy link
Owner

@liudger liudger commented Feb 23, 2026

This pull request enhances the documentation and data modeling for hot water scheduling in the BSB-LAN integration. The main improvements clarify the handling and representation of time program schedules and introduce a new data type for these schedules.

Data modeling improvements:

  • Added a new TIMEPROG value (9) to the DataType enum to represent time program (schedule slots) data types, improving clarity and type safety for schedule-related fields (src/bsblan/models.py).

Documentation enhancements:

  • Expanded the docstring for the HotWaterSchedule class to explain the format and usage of daily time program fields, including examples and notes about the dhw_time_program_standard_values reset behavior (src/bsblan/models.py).
  • Added a clarifying comment to the dhw_time_program_standard_values field to indicate it is a YESNO enum and describes its effect when set (src/bsblan/models.py).

Copilot AI review requested due to automatic review settings February 23, 2026 12:16
@liudger liudger added the bugfix Inconsistencies or issues which will cause a problem for users or implementers. label Feb 23, 2026
Copy link
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

This pull request adds a new TIMEPROG data type (value 9) to the DataType enum to represent BSB-LAN time program schedule data, and enhances the documentation for the HotWaterSchedule class to explain the format and behavior of daily time program fields.

Changes:

  • Added TIMEPROG = 9 to the DataType enum for time program schedule slots
  • Enhanced the HotWaterSchedule class docstring with details about time program format and usage
  • Added an inline comment clarifying that dhw_time_program_standard_values is a YESNO enum that resets schedules

Comment on lines +532 to +535
The daily time programs (Monday-Sunday) use BSB-LAN dataType 9
(TIMEPROG) and return schedule strings like
``"13:00-15:00 ##:##-##:## ##:##-##:##"`` where ``##:##`` marks
unused time slots.
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

The documentation claims that daily time programs use BSB-LAN dataType 9 (TIMEPROG), but the existing test fixture in test_hot_water_additional.py uses dataType 0 (PLAIN_NUMBER) for all schedule parameters (lines 153, 160, 167, 174, 181, 188, 195). This creates a discrepancy between the documentation and the test data. Either the test fixtures should be updated to use dataType 9, or the documentation should be corrected to reflect the actual dataType used by BSB-LAN devices for time program parameters.

Copilot uses AI. Check for mistakes.
DATE = 6 # Day and month
STRING = 7 # String value
PPS_TIME = 8 # PPS time (day of week, hour:minute)
TIMEPROG = 9 # Time program (schedule slots)
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

The new TIMEPROG data type is added to the DataType enum but is not handled in the _convert_bsblan_value function (lines 222-269). This function has explicit handling for PLAIN_NUMBER, ENUM, TIME, and WEEKDAY types, but other types including STRING, PPS_TIME, and now TIMEPROG fall through to the default string handling. While this may be intentional (keeping time program strings as-is), it should be verified that TIMEPROG values don't require special parsing, or explicit handling should be added for clarity and consistency with the comment on line 219.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.88%. Comparing base (195332c) to head (4e3b812).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1363   +/-   ##
=======================================
  Coverage   99.88%   99.88%           
=======================================
  Files           6        6           
  Lines         907      908    +1     
  Branches      128      128           
=======================================
+ Hits          906      907    +1     
  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.

@sonarqubecloud
Copy link

@liudger liudger merged commit ff06d9e into main Feb 23, 2026
14 checks passed
@liudger liudger deleted the fix-dhw-shedule branch February 23, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Inconsistencies or issues which will cause a problem for users or implementers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant