From 12f6629e76c584086916a3af0be9b19c1ffd4972 Mon Sep 17 00:00:00 2001 From: Willem-Jan van Rootselaar Date: Mon, 23 Feb 2026 13:15:47 +0100 Subject: [PATCH 1/3] Add TIMEPROG data type and enhance HotWaterSchedule documentation --- src/bsblan/models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/bsblan/models.py b/src/bsblan/models.py index ac6ca63c..53116f03 100644 --- a/src/bsblan/models.py +++ b/src/bsblan/models.py @@ -216,6 +216,7 @@ class DataType(IntEnum): 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) def _convert_bsblan_value( @@ -528,6 +529,15 @@ class HotWaterSchedule(BaseModel): This class contains time program settings that are typically configured once and rarely changed. + 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. + + ``dhw_time_program_standard_values`` is a YESNO enum (0=No, 1=Yes) + that resets all daily schedules back to the controller's factory + defaults when set to Yes. It is typically read-only via the API. + Note: This is for READING from the device. For WRITING time programs, use SetHotWaterParam with set_hot_water(). @@ -541,6 +551,7 @@ class HotWaterSchedule(BaseModel): dhw_time_program_friday: EntityInfo[str | int] | None = None dhw_time_program_saturday: EntityInfo[str | int] | None = None dhw_time_program_sunday: EntityInfo[str | int] | None = None + # YESNO enum: resets all daily schedules to factory defaults when Yes (1) dhw_time_program_standard_values: EntityInfo[int] | None = None From c1dbe55e6f3de7c040491edcc4f72ab9798de755 Mon Sep 17 00:00:00 2001 From: Willem-Jan van Rootselaar Date: Mon, 23 Feb 2026 13:19:14 +0100 Subject: [PATCH 2/3] Fix typo in HotWaterSchedule documentation regarding daily time programs --- src/bsblan/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bsblan/models.py b/src/bsblan/models.py index 53116f03..33812a14 100644 --- a/src/bsblan/models.py +++ b/src/bsblan/models.py @@ -529,7 +529,7 @@ class HotWaterSchedule(BaseModel): This class contains time program settings that are typically configured once and rarely changed. - The daily time programs (Monday–Sunday) use BSB-LAN dataType 9 + 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. From 4e3b812ad8c97d8e01020714265a94bafbc07dd9 Mon Sep 17 00:00:00 2001 From: Willem-Jan van Rootselaar Date: Mon, 23 Feb 2026 13:23:48 +0100 Subject: [PATCH 3/3] Add tests for TIMEPROG value handling in EntityInfo --- tests/test_entity_info.py | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/test_entity_info.py b/tests/test_entity_info.py index e535630e..323bd61d 100644 --- a/tests/test_entity_info.py +++ b/tests/test_entity_info.py @@ -222,3 +222,44 @@ def test_entity_info_string_plain_text_not_parsed() -> None: assert entity.value == "1.0.38-20200730" assert entity.unit == "" + + +def test_entity_info_timeprog_schedule_string() -> None: + """Test TIMEPROG value with active and unused slots is kept as string.""" + entity = EntityInfo( + name="Monday", + value="13:00-15:00 ##:##-##:## ##:##-##:##", + unit="", + desc="", + data_type=DataType.TIMEPROG, + ) + + assert entity.value == "13:00-15:00 ##:##-##:## ##:##-##:##" + assert entity.data_type == DataType.TIMEPROG + + +def test_entity_info_timeprog_multiple_slots() -> None: + """Test TIMEPROG value with multiple active time slots.""" + entity = EntityInfo( + name="Tuesday", + value="06:00-08:00 17:00-21:00 ##:##-##:##", + unit="", + desc="", + data_type=DataType.TIMEPROG, + ) + + assert entity.value == "06:00-08:00 17:00-21:00 ##:##-##:##" + assert entity.data_type == DataType.TIMEPROG + + +def test_entity_info_timeprog_inactive() -> None: + """Test TIMEPROG with '---' (inactive/not in use) returns None.""" + entity = EntityInfo( + name="Sunday", + value="---", + unit="", + desc="", + data_type=DataType.TIMEPROG, + ) + + assert entity.value is None