Skip to content

Commit 4fc05ab

Browse files
committed
Rename param 716/1016 to comfort_setpoint_max
Param 716/1016 is the comfort setpoint maximum, not a generic max temperature. Rename it to comfort_setpoint_max for clarity and source the circuit max bound from it, falling back to max_temp for PPS circuits (15007). PPS keeps min_temp/max_temp (15006/15007) unchanged.
1 parent 3a4c256 commit 4fc05ab

10 files changed

Lines changed: 21 additions & 14 deletions

File tree

examples/control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def print_static_state(static_state: StaticState) -> None:
203203
"Reduced Setpoint (eco/night)": get_attribute(
204204
static_state.temp_reduced_setpoint
205205
),
206-
"Max Temperature (heating)": get_attribute(static_state.max_temp),
206+
"Max Temperature (heating)": get_attribute(static_state.comfort_setpoint_max),
207207
"Heating Protective Setpoint": get_attribute(
208208
static_state.heating_protective_setpoint
209209
),

src/bsblan/bsblan.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,12 @@ async def _fetch_temperature_range(
643643
temp_range["min"],
644644
)
645645

646-
if static_values.max_temp is not None:
647-
temp_range["max"] = static_values.max_temp.value
646+
# Prefer comfort_setpoint_max (716/1016) as the upper bound for standard
647+
# circuits. Fall back to max_temp for PPS circuits (15007) which expose
648+
# only a generic max.
649+
max_source = static_values.comfort_setpoint_max or static_values.max_temp
650+
if max_source is not None:
651+
temp_range["max"] = max_source.value
648652
logger.debug(
649653
"Circuit %d max temp initialized: %s",
650654
circuit,

src/bsblan/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class APIConfig(TypedDict):
4242
BASE_STATIC_VALUES_PARAMS: Final[dict[str, str]] = {
4343
"712": "temp_reduced_setpoint",
4444
"714": "heating_protective_setpoint",
45-
"716": "max_temp",
45+
"716": "comfort_setpoint_max",
4646
"905": "cooling_comfort_setpoint_min",
4747
"903": "cooling_reduced_setpoint",
4848
}
@@ -109,7 +109,7 @@ class APIConfig(TypedDict):
109109
BASE_STATIC_VALUES_CIRCUIT2_PARAMS: Final[dict[str, str]] = {
110110
"1012": "temp_reduced_setpoint",
111111
"1014": "heating_protective_setpoint",
112-
"1016": "max_temp",
112+
"1016": "comfort_setpoint_max",
113113
"1205": "cooling_comfort_setpoint_min",
114114
"1203": "cooling_reduced_setpoint",
115115
}

src/bsblan/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,8 @@ class StaticState(BaseModel):
483483
temp_reduced_setpoint: EntityInfo[float] | None = None
484484
# 714/1014: frost-protection lower bound; also used by PPS as min_temp (15006)
485485
min_temp: EntityInfo[float] | None = None
486+
# 716/1016: comfort setpoint max upper bound; PPS uses max_temp (15007)
487+
comfort_setpoint_max: EntityInfo[float] | None = None
486488
max_temp: EntityInfo[float] | None = None
487489
heating_protective_setpoint: EntityInfo[float] | None = None
488490
cooling_comfort_setpoint_min: EntityInfo[float] | None = None

tests/fixtures/dict_version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"staticValues": {
1010
"712": "temp_reduced_setpoint",
1111
"714": "heating_protective_setpoint",
12-
"716": "max_temp"
12+
"716": "comfort_setpoint_max"
1313
},
1414
"device": {
1515
"6224": "device_identification",

tests/test_circuit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ async def test_static_values_circuit2(monkeypatch: Any) -> None:
227227
assert isinstance(static, StaticState)
228228
assert static.temp_reduced_setpoint is not None
229229
assert static.temp_reduced_setpoint.value == 16.0
230-
assert static.max_temp is not None
231-
assert static.max_temp.value == 28.0
230+
assert static.comfort_setpoint_max is not None
231+
assert static.comfort_setpoint_max.value == 28.0
232232
assert static.heating_protective_setpoint is not None
233233
assert static.heating_protective_setpoint.value == 8.0
234234
assert static.cooling_comfort_setpoint_min is not None

tests/test_constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ def test_cooling_target_uses_single_base_parameter() -> None:
130130
assert config["heating_circuit2"]["1202"] == "target_temperature_high"
131131
assert config["staticValues"]["712"] == "temp_reduced_setpoint"
132132
assert config["staticValues"]["714"] == "heating_protective_setpoint"
133-
assert config["staticValues"]["716"] == "max_temp"
133+
assert config["staticValues"]["716"] == "comfort_setpoint_max"
134134
assert config["staticValues"]["905"] == "cooling_comfort_setpoint_min"
135135
assert config["staticValues"]["903"] == "cooling_reduced_setpoint"
136136
assert config["staticValues_circuit2"]["1012"] == "temp_reduced_setpoint"
137137
assert config["staticValues_circuit2"]["1014"] == ("heating_protective_setpoint")
138-
assert config["staticValues_circuit2"]["1016"] == "max_temp"
138+
assert config["staticValues_circuit2"]["1016"] == "comfort_setpoint_max"
139139
assert config["staticValues_circuit2"]["1205"] == ("cooling_comfort_setpoint_min")
140140
assert config["staticValues_circuit2"]["1203"] == "cooling_reduced_setpoint"
141141
assert "908" not in config["staticValues"]

tests/test_static_state.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ async def test_sensor(monkeypatch: Any) -> None:
4343
assert static.temp_reduced_setpoint is not None
4444
assert static.temp_reduced_setpoint.value == 17.0
4545
assert static.min_temp is None
46-
assert static.max_temp is not None
47-
assert static.max_temp.value == 23.0
46+
assert static.comfort_setpoint_max is not None
47+
assert static.comfort_setpoint_max.value == 23.0
4848
assert static.heating_protective_setpoint is not None
4949
assert static.heating_protective_setpoint.value == 8.0
5050
assert static.cooling_comfort_setpoint_min is not None

tests/test_temperature_validation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ async def test_temperature_range_max_temp_not_available(monkeypatch: Any) -> Non
192192
static_values_mock = AsyncMock()
193193
static_values_mock.return_value.min_temp = AsyncMock()
194194
static_values_mock.return_value.min_temp.value = "10"
195+
static_values_mock.return_value.comfort_setpoint_max = None
195196
static_values_mock.return_value.max_temp = None
196197
monkeypatch.setattr(client, "static_values", static_values_mock)
197198

tests/test_utility_additional.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ def fresh_api_validator() -> APIValidator:
4141
"710": "target_temperature",
4242
},
4343
"staticValues": {
44-
"712": "min_temp",
44+
"712": "temp_reduced_setpoint",
4545
"714": "heating_protective_setpoint",
46-
"716": "max_temp",
46+
"716": "comfort_setpoint_max",
4747
},
4848
"hot_water": {
4949
"8830": "dhw_actual_value_top_temperature",

0 commit comments

Comments
 (0)