almost completed loft insulation

This commit is contained in:
Khalim Conn-Kowlessar 2023-10-20 19:01:30 +11:00
parent 13ceb4031d
commit 67e6a555f0

View file

@ -47,35 +47,17 @@ class RoofRecommendations:
u_value = get_roof_u_value(**{**self.property.roof, "age_band": self.property.age_band})
# With loft insulation, 100mm goes between the joists and the rest is rolled on top
# Therefore the price is 100mm + whatever thickness is rolled on top, rolled at a 90 degree angle
# from the base layer
materials = [
{
'id': 4,
'type': 'loft_insulation',
'description': 'Iso Spacesaver Mineral Wool insulation',
'depths': [270, 300],
'depth_unit': 'mm',
'cost': [9, 10],
'cost_unit': 'gbp_sq_meter',
'r_value_per_mm': 0.022727272727272728,
'r_value_unit': 'square_meter_kelvin_per_watt',
'thermal_conductivity': 0.044,
'thermal_conductivity_unit': 'watt_per_meter_kelvin',
'link': "https://flooringwarehousedirect.co.uk/product/isover-spacesaver-roll-100mm-x-1160mm-x-12-18m"
"-14-13m2/",
'is_active': True
},
]
self.materials = materials
if self.property.roof["is_pitched"]:
# We recommend loft insulation
self.recommend_loft_insulation(u_value)
return
raise NotImplementedError("Implement me")
@staticmethod
def make_loft_insulation_description(material, depth):
return f"Install {depth}{material['depth_unit']} of {material['description']}"
def recommend_loft_insulation(self, u_value):
"""
@ -83,6 +65,10 @@ class RoofRecommendations:
:return:
"""
# With loft insulation, 100mm goes between the joists and the rest is rolled on top
# Therefore the price is 100mm + whatever thickness is rolled on top, rolled at a 90 degree angle
# from the base layer
loft_insulation_materials = [m for m in self.materials if m["type"] == "loft_insulation"]
lowest_selected_u_value = None
@ -111,7 +97,7 @@ class RoofRecommendations:
if new_u_value <= self.BUILDING_REGULATIONS_PART_L_MAX_U_VALUE:
lowest_selected_u_value = update_lowest_selected_u_value(lowest_selected_u_value, new_u_value)
estimated_cost = cost_per_unit * self.property.insulation_wall_area
estimated_cost = cost_per_unit * self.property.floor_area
recommendations.append(
{
@ -125,10 +111,12 @@ class RoofRecommendations:
)
],
"type": "roof_insulation",
"description": "TODO ",
"description": self.make_loft_insulation_description(material, depth),
"starting_u_value": u_value,
"new_u_value": new_u_value,
"sap_points": None,
"cost": estimated_cost,
}
)
self.recommendations = recommendations