Resolve electric-underfloor overrides to their own SAP codes dragging electricity 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-01 16:36:21 +00:00
parent ef34f76116
commit 749ac3a5ff
2 changed files with 18 additions and 0 deletions

View file

@ -116,6 +116,9 @@ _ELECTRIC_ROOM_HEATER_CODES = frozenset(range(691, 702))
# unambiguously electric, so they drag electricity like the electric room heaters
# (ADR-0045, closing the prior no-fuel gap on 191/192).
_ELECTRIC_BOILER_CODES = frozenset({191, 192})
# Electric underfloor — SAP Table 4a 421/422 (off-peak) and 424 (screed) — also
# unambiguously electric (ADR-0046).
_ELECTRIC_UNDERFLOOR_CODES = frozenset({421, 422, 424})
# Heat pumps (SAP Table 4a 211-224 wet, 521-527 warm-air) are category 4 and
# unambiguously electric (natural fuel 29). Modellable on the default code's SPF
@ -184,6 +187,13 @@ _MAIN_HEATING_CODES: dict[str, int] = {
# Electric CPSU — SAP Table 4a 192. Electric (drags 29), on an off-peak Dual
# meter (already in _ASSUMED_DUAL_METER_CODES; §12 Rule 1 10-hour) — ADR-0045.
"Electric CPSU": 192,
# Electric underfloor — dedicated SAP Table 4a codes, all electric (drag 29).
# 421 concrete slab / 422 integrated are off-peak (Dual, §12 Rule 2); 424
# screed is tariff-ambiguous ("standard or off peak") so it DEFERS the meter to
# the cert (ADR-0046).
"Electric underfloor, in concrete slab (off-peak)": 421,
"Electric underfloor, integrated storage and direct-acting": 422,
"Electric underfloor, in screed above insulation": 424,
"Electric room heaters": 691,
"Solid fuel room heater, closed": 633,
# Solid-fuel room heaters off the Gas CPSU dumping ground (ADR-0045). SAP
@ -264,6 +274,7 @@ def _natural_fuel_for(code: int) -> Optional[int]:
or code in _HEAT_PUMP_CODES
or code == _HHR_STORAGE_CODE
or code in _ELECTRIC_BOILER_CODES
or code in _ELECTRIC_UNDERFLOOR_CODES
):
return _ELECTRICITY_FUEL
if code in _SOLID_FUEL_ROOM_HEATER_CODES:

View file

@ -29,6 +29,13 @@ class MainHeatingSystemType(Enum):
DIRECT_ELECTRIC = "Direct-acting electric"
ELECTRIC_BOILER = "Electric boiler"
ELECTRIC_CPSU = "Electric CPSU"
ELECTRIC_UNDERFLOOR_SLAB_OFF_PEAK = (
"Electric underfloor, in concrete slab (off-peak)"
)
ELECTRIC_UNDERFLOOR_INTEGRATED = (
"Electric underfloor, integrated storage and direct-acting"
)
ELECTRIC_UNDERFLOOR_SCREED = "Electric underfloor, in screed above insulation"
ELECTRIC_ROOM_HEATERS = "Electric room heaters"
SOLID_FUEL_ROOM_HEATER_CLOSED = "Solid fuel room heater, closed"
SOLID_FUEL_ROOM_HEATER_OPEN_FIRE = "Solid fuel room heater, open fire"