debugging

This commit is contained in:
Khalim Conn-Kowlessar 2024-08-01 13:21:12 +01:00
parent 59ae6647b3
commit 40b89f7cb8

View file

@ -229,9 +229,11 @@ class HeatingRecommender:
ashp_recommendations = [] ashp_recommendations = []
for controls_rec in controls_recommendations: for controls_rec in controls_recommendations:
ashp_costs_with_controls = ashp_costs.copy()
if controls_rec: if controls_rec:
for key in ashp_costs: for key in ashp_costs_with_controls:
ashp_costs[key] += controls_rec[key] ashp_costs_with_controls[key] += controls_rec[key]
if controls_rec is None: if controls_rec is None:
description = "Install an air source heat pump." description = "Install an air source heat pump."
@ -244,13 +246,16 @@ class HeatingRecommender:
# includes the boiler upgrade scheme and that the cavity and loft need to be treated, to ensure access # includes the boiler upgrade scheme and that the cavity and loft need to be treated, to ensure access
# to the funding # to the funding
if has_cavity_or_loft_recommendations: if has_cavity_or_loft_recommendations:
description = description + (f" The cost includes the £" description = description + (
f"{BOILER_UPGRADE_SCHEME_ASHP_VALUE} boiler upgrade scheme grant. " f" The cost includes the £"
f"You must ensure that the property has an insulated cavity and " f"{BOILER_UPGRADE_SCHEME_ASHP_VALUE} boiler upgrade scheme grant. "
f"270mm+ loft insulation to qualify for the grant") f"You must ensure that the property has an insulated cavity and "
f"270mm+ loft insulation to qualify for the grant"
)
else: else:
description = description + (f" The cost includes the £" description = description + (
f"{BOILER_UPGRADE_SCHEME_ASHP_VALUE} boiler upgrade scheme grant") f" The cost includes the £{BOILER_UPGRADE_SCHEME_ASHP_VALUE} boiler upgrade scheme grant"
)
simulation_config = { simulation_config = {
"mainheat_energy_eff_ending": "Good", "mainheat_energy_eff_ending": "Good",
@ -321,7 +326,7 @@ class HeatingRecommender:
"already_installed": already_installed, "already_installed": already_installed,
"simulation_config": simulation_config, "simulation_config": simulation_config,
"description_simulation": description_simulation, "description_simulation": description_simulation,
**ashp_costs **ashp_costs_with_controls
} }
ashp_recommendations.append(ashp_recommendation) ashp_recommendations.append(ashp_recommendation)