diff --git a/recommendations/HeatingRecommender.py b/recommendations/HeatingRecommender.py index fd2dfe38..ab377369 100644 --- a/recommendations/HeatingRecommender.py +++ b/recommendations/HeatingRecommender.py @@ -229,9 +229,11 @@ class HeatingRecommender: ashp_recommendations = [] for controls_rec in controls_recommendations: + ashp_costs_with_controls = ashp_costs.copy() + if controls_rec: - for key in ashp_costs: - ashp_costs[key] += controls_rec[key] + for key in ashp_costs_with_controls: + ashp_costs_with_controls[key] += controls_rec[key] if controls_rec is None: 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 # to the funding if has_cavity_or_loft_recommendations: - description = description + (f" The cost includes the £" - f"{BOILER_UPGRADE_SCHEME_ASHP_VALUE} boiler upgrade scheme grant. " - f"You must ensure that the property has an insulated cavity and " - f"270mm+ loft insulation to qualify for the grant") + description = description + ( + f" The cost includes the £" + f"{BOILER_UPGRADE_SCHEME_ASHP_VALUE} boiler upgrade scheme grant. " + f"You must ensure that the property has an insulated cavity and " + f"270mm+ loft insulation to qualify for the grant" + ) else: - description = description + (f" The cost includes the £" - f"{BOILER_UPGRADE_SCHEME_ASHP_VALUE} boiler upgrade scheme grant") + description = description + ( + f" The cost includes the £{BOILER_UPGRADE_SCHEME_ASHP_VALUE} boiler upgrade scheme grant" + ) simulation_config = { "mainheat_energy_eff_ending": "Good", @@ -321,7 +326,7 @@ class HeatingRecommender: "already_installed": already_installed, "simulation_config": simulation_config, "description_simulation": description_simulation, - **ashp_costs + **ashp_costs_with_controls } ashp_recommendations.append(ashp_recommendation)