Drag HHRSH's intrinsic control, electricity fuel and off-peak meter 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-01 14:29:41 +00:00
parent ca10966c38
commit 01e7e1d831

View file

@ -67,6 +67,12 @@ _ASSUMED_DUAL_METER_CODES = OFF_PEAK_IMPLYING_HEATING_CODES | _ROOM_HEATER_CODES
# systems that take a charge control.
_MANUAL_CHARGE_CONTROL = 2401
_STORAGE_HEATER_CODES = frozenset(range(401, 410))
# High heat retention storage heaters (SAP Table 4a 409) take a SINGLE intrinsic
# charge control — Table 4e 2404 (HHR, 0 C adjustment). It is named by the
# archetype, not unobserved, so 409 drags 2404 rather than the manual default
# (ADR-0044) — the only storage code that overrides `_MANUAL_CHARGE_CONTROL`.
_HHR_STORAGE_CODE = 409
_HHR_CHARGE_CONTROL = 2404
# SAP Table 4a category 10 ("Room heaters") and its conservative Table 4e Group 6
# control. A landlord names a room heater, not its control; code 2601 ("no
@ -207,6 +213,8 @@ def _control_for(code: int) -> Optional[int]:
conservative manual charge control for storage heaters, full modern controls
for a gas boiler, None for systems that take neither (direct-acting electric).
Overwrites a stale control inherited from the system being replaced."""
if code == _HHR_STORAGE_CODE:
return _HHR_CHARGE_CONTROL
if code in _STORAGE_HEATER_CODES:
return _MANUAL_CHARGE_CONTROL
if code in _GAS_BOILER_CODES:
@ -233,7 +241,11 @@ def _natural_fuel_for(code: int) -> Optional[int]:
"""The fuel an archetype unambiguously implies (a coherent default), or None
where the fuel is ambiguous and must come from the `main_fuel` override. A
present `main_fuel` override wins by last-wins composition."""
if code in _ELECTRIC_ROOM_HEATER_CODES or code in _HEAT_PUMP_CODES:
if (
code in _ELECTRIC_ROOM_HEATER_CODES
or code in _HEAT_PUMP_CODES
or code == _HHR_STORAGE_CODE
):
return _ELECTRICITY_FUEL
if code in _SOLID_FUEL_ROOM_HEATER_CODES:
return _HOUSE_COAL_FUEL