From 60e27c80a1757d3bf117d23087994adabd246622 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 30 Jun 2026 18:03:07 +0000 Subject: [PATCH] =?UTF-8?q?Recognise=20gas=20room-heater=20variants=20by?= =?UTF-8?q?=20their=20SAP=20codes=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- .../epc/test_main_heating_system_overlay.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/domain/epc/test_main_heating_system_overlay.py b/tests/domain/epc/test_main_heating_system_overlay.py index 804183a3b..d8431e7ef 100644 --- a/tests/domain/epc/test_main_heating_system_overlay.py +++ b/tests/domain/epc/test_main_heating_system_overlay.py @@ -555,3 +555,31 @@ def test_oil_room_heater_drags_its_coherent_room_heater_companions() -> None: assert heating.main_heating_control == 2601 assert heating.main_fuel_type == 28 assert heating.meter_type == "Single" + + +@pytest.mark.parametrize( + ("value", "code"), + [ + ("Gas room heater, condensing fire", 611), + ("Gas room heater, decorative fuel-effect", 612), + ("Gas room heater, flush live-effect", 605), + ("Gas room heater, open flue 1980 or later", 603), + ("Gas room heater, open flue pre-1980", 601), + ], +) +def test_gas_room_heater_variants_decode_to_their_sap_codes( + value: str, code: int +) -> None: + # Gas room heaters span a wide efficiency range (decorative 0.20 -> condensing + # 0.85), so each catalogue variant maps to its own SAP Table 4a code rather + # than collapsing to one representative — which would over-credit a decorative + # fire and under-credit a condensing one. Today they mis-bucket to "Gas + # boiler, regular" (ADR-0041). + + # Act + simulation = main_heating_overlay_for(value, 0) + + # Assert + assert simulation is not None + assert simulation.heating is not None + assert simulation.heating.sap_main_heating_code == code