From 1f1bb8a5561e9deb15d33f0580fd6dbe591a9a98 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 14 Jul 2026 23:17:30 +0000 Subject: [PATCH] =?UTF-8?q?Withhold=20roof=20insulation=20from=20RIR=20sur?= =?UTF-8?q?faces=20the=20surveyor=20marked=20insulation-unknown=20?= =?UTF-8?q?=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- datatypes/epc/domain/mapper.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/datatypes/epc/domain/mapper.py b/datatypes/epc/domain/mapper.py index 6bfd5154c..d6d2443f6 100644 --- a/datatypes/epc/domain/mapper.py +++ b/datatypes/epc/domain/mapper.py @@ -6014,6 +6014,18 @@ def _pashub_room_in_roof( if isinstance(roof.insulation_thickness_mm, int) else None ) + # Newer survey forms ask per surface "Are you able to provide details of + # the insulation …?" — a "No" (fixture 499617935574: loft hatch screwed + # shut) means the roof-space thickness is NOT evidence for that surface, + # which must fall back to the Table 18 col(4) age-band "unknown" default. + # On such a form, surfaces the question never covers (common walls) get + # no threading either. Legacy forms (question absent everywhere) keep the + # unconditional threading above. + form_asks_insulation_known = any( + d.insulation_known is not None + for group in (rir.gables, rir.slopes, rir.common_walls, rir.flat_ceilings) + for d in group or [] + ) def _add( details: Optional[List[RoomInRoofSurfaceDetail]], @@ -6030,12 +6042,15 @@ def _pashub_room_in_roof( "room-in-roof gable type", str(d.gable_type) ) surface_kind = _PASHUB_GABLE_TYPE_TO_KIND[d.gable_type] + thickness = insulation_thickness_mm + if form_asks_insulation_known and not d.insulation_known: + thickness = None surfaces.append( SapRoomInRoofSurface( kind=surface_kind, area_m2=d.length_m * d.height_m, u_value=d.u_value, - insulation_thickness_mm=insulation_thickness_mm, + insulation_thickness_mm=thickness, ) )