diff --git a/domain/sap10_calculator/tables/table_12a.py b/domain/sap10_calculator/tables/table_12a.py index e4a07f1b..f98e1c27 100644 --- a/domain/sap10_calculator/tables/table_12a.py +++ b/domain/sap10_calculator/tables/table_12a.py @@ -83,6 +83,11 @@ _METER_STR_TO_INT: Final[dict[str, int]] = { "dual": 1, "dual (24 hour)": 4, "off-peak 18 hour": 5, + # RdSAP 10 §17 page 85 row 10-2 lodging form: "18-hour" (Elmhurst + # Summary §14.2 surfaces this as the bare "18 Hour"). Per §12 + # page 62: "if the meter is dual 18-hour/24-hour it is 18-hour/ + # 24-hour tariff" → enum 5 (EIGHTEEN_HOUR). + "18 hour": 5, "unknown": 3, "": 3, } diff --git a/domain/sap10_calculator/tests/test_table_12a.py b/domain/sap10_calculator/tests/test_table_12a.py index 3135881e..2b294ca2 100644 --- a/domain/sap10_calculator/tests/test_table_12a.py +++ b/domain/sap10_calculator/tests/test_table_12a.py @@ -51,6 +51,13 @@ def test_tariff_enum_has_five_members() -> None: ("Dual", Tariff.SEVEN_HOUR), ("Dual (24 hour)", Tariff.TWENTY_FOUR_HOUR), ("Off-peak 18 hour", Tariff.EIGHTEEN_HOUR), + # RdSAP 10 §17 page 85 (Electricity meter row 10-2): + # "Dual/single/10-hour/18-hour/24-hour/unknown". The Elmhurst + # Summary §14.2 lodges the bare form "18 Hour" (not the + # "Off-peak 18 hour" alias above). Per §12 page 62: "if the + # meter is dual 18-hour/24-hour it is 18-hour/24-hour tariff", + # so the bare lodging routes directly to EIGHTEEN_HOUR. + ("18 Hour", Tariff.EIGHTEEN_HOUR), # Per Q11b: "Unknown" maps to STANDARD (no off-peak heuristic). ("Unknown", Tariff.STANDARD), ("", Tariff.STANDARD),