Map main_heating_controls in the older RdSAP mappers for the FE panel 🟥

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-06-25 21:41:41 +00:00
parent 5deea0a27c
commit a975d870c9

View file

@ -2653,3 +2653,52 @@ def test_gov_mappers_split_non_separated_conservatory(fixture: str) -> None:
)
assert len(epc.sap_building_parts) == base_parts
assert all(bp.construction_age_band is not None for bp in epc.sap_building_parts)
@pytest.mark.parametrize(
"schema_cls, mapper, fixture, expected",
[
(
RdSapSchema17_1,
EpcPropertyDataMapper.from_rdsap_schema_17_1,
"17_1.json",
"Programmer and room thermostat",
),
(
RdSapSchema18_0,
EpcPropertyDataMapper.from_rdsap_schema_18_0,
"18_0.json",
"Programmer, room thermostat and TRVs",
),
(
RdSapSchema19_0,
EpcPropertyDataMapper.from_rdsap_schema_19_0,
"19_0.json",
"Programmer, room thermostat and TRVs",
),
(
RdSapSchema20_0_0,
EpcPropertyDataMapper.from_rdsap_schema_20_0_0,
"20_0_0.json",
"Programmer, room thermostat and TRVs",
),
(
RdSapSchema21_0_0,
EpcPropertyDataMapper.from_rdsap_schema_21_0_0,
"21_0_0.json",
"Programmer, room thermostat and TRVs",
),
],
)
def test_rdsap_mappers_carry_main_heating_controls_display(
schema_cls: Any, mapper: Any, fixture: str, expected: str
) -> None:
# "Heating Control" panel row. 17.0 and 21.0.1 already map it; these five
# dropped it, leaving the FE "Unknown" despite the cert lodging it. Display
# only — the calculator reads the control CODE separately (ADR-0037 family).
schema = from_dict(schema_cls, load(fixture))
result = mapper(schema)
assert result.main_heating_controls is not None
assert result.main_heating_controls.description == expected