Electric boiler and CPSU overrides stamp the Table 4a boiler category (2) 🟩

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-03 14:06:52 +00:00
parent 6d8139e47e
commit 82cb567a1d

View file

@ -130,6 +130,13 @@ _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})
# SAP Table 4a "boiler system" category — codes 191/192 are wet electric
# boilers, same category the gas-boiler overlay stamps. Forced so an
# electric-boiler override never keeps the replaced system's category: on
# portfolio 796 an inherited 6 (community) or 4 (heat pump) suppressed the
# HHRSH pathway, and an inherited 7 (storage) made the Table 12a resolver bill
# direct-acting heat wholly at the off-peak low rate (ADR-0052, #1444).
_ELECTRIC_BOILER_CATEGORY = 2
# Electric underfloor — SAP Table 4a 421/422 (off-peak) and 424 (screed) — also
# unambiguously electric (ADR-0046).
_ELECTRIC_UNDERFLOOR_CODES = frozenset({421, 422, 424})
@ -304,6 +311,8 @@ def _category_for(code: int) -> Optional[int]:
return _STORAGE_HEATER_CATEGORY
if code in _ELECTRIC_UNDERFLOOR_CODES:
return _UNDERFLOOR_CATEGORY
if code in _ELECTRIC_BOILER_CODES:
return _ELECTRIC_BOILER_CATEGORY
if code in _HEAT_PUMP_CODES:
return _HEAT_PUMP_CATEGORY
if code in _HEAT_NETWORK_CODES: