diff --git a/backend/Property.py b/backend/Property.py index 580dbb89..4d5a93a7 100644 --- a/backend/Property.py +++ b/backend/Property.py @@ -350,6 +350,7 @@ class Property: r for r in property_representative_recommendations if r["phase"] <= phase ] + # TODO: This is placeholder, but it's to handle the case of having both internal and external wall # insulation as options. This will cause the process below to fall over, so we take just # external wall insulation in epc_transformations, if we have both diff --git a/recommendations/HeatingControlRecommender.py b/recommendations/HeatingControlRecommender.py index 1aae3973..de935d7a 100644 --- a/recommendations/HeatingControlRecommender.py +++ b/recommendations/HeatingControlRecommender.py @@ -100,9 +100,10 @@ class HeatingControlRecommender: We can then consider the heating system itself :return: """ + new_description = "Controls for high heat retention storage heaters" # We recommend upgrading to Celect type controls - ending_config = MainheatControlAttributes("Controls for high heat retention storage heaters").process() + ending_config = MainheatControlAttributes(new_description).process() # We look at what has changed in the ending config, and compare it to the current config simulation_config = check_simulation_difference( new_config=ending_config, old_config=self.property.main_heating_controls @@ -110,11 +111,17 @@ class HeatingControlRecommender: # This upgrade will only take the heating system to average energy efficiency simulation_config["mainheatc_energy_eff_ending"] = "Good" + description_simulation = { + "mainheatcont-description": new_description, + "mainheatc-energy-eff": simulation_config["mainheatc_energy_eff_ending"] + } + self.recommendation.append( { "description": "upgrade heating controls to High Heat Retention Storage Heater Controls", **self.costs.celect_type_controls(), - "simulation_config": simulation_config + "simulation_config": simulation_config, + "description_simulation": description_simulation } ) diff --git a/recommendations/HeatingRecommender.py b/recommendations/HeatingRecommender.py index 0afdc18f..8aed4108 100644 --- a/recommendations/HeatingRecommender.py +++ b/recommendations/HeatingRecommender.py @@ -55,7 +55,7 @@ class HeatingRecommender: # TODO: We could have a system flush recommendation for an existing boiler, where there is no need to replace # the boiler, but instead flushing the system will make it run more efficiently. There is a cost for this # in the Costs class, stored as SYSTEM_FLUSH_COST - + exclusions = [] if exclusions is None else exclusions self.heating_recommendations = [] @@ -330,7 +330,14 @@ class HeatingRecommender: return differences def combine_heating_and_controls( - self, controls_recommendations, heating_simulation_config, costs, description, phase, heating_controls_only, + self, + controls_recommendations, + heating_simulation_config, + heating_description_simulation, + costs, + description, + phase, + heating_controls_only, system_change ): """ @@ -338,6 +345,7 @@ class HeatingRecommender: into a single recommendation :param controls_recommendations: The heating controls recommendations :param heating_simulation_config: The simulation configuration for the heating system + :param heating_description_simulation: The simulation configuration for the heating description :param costs: The costs of the heating system :param description: The description of the recommendation :param phase: The phase of the recommendation @@ -361,6 +369,7 @@ class HeatingRecommender: for controls_switch in heating_controls_switch: total_costs = costs.copy() recommendation_simulation_config = heating_simulation_config.copy() + recommendation_description_simulation = heating_description_simulation.copy() recommendation_description = description if controls_switch: # We add the costs of the heating controls, onto each key in the costs dictionary @@ -371,6 +380,12 @@ class HeatingRecommender: **recommendation_simulation_config, **controls_recommendations[0]["simulation_config"] } + + recommendation_description_simulation = { + **recommendation_description_simulation, + **controls_recommendations[0]["description_simulation"] + } + controls_description = controls_recommendations[0]['description'] # Make the first letter of the description lowercase controls_description = ( @@ -396,7 +411,8 @@ class HeatingRecommender: "sap_points": None, "already_installed": already_installed, **total_costs, - "simulation_config": recommendation_simulation_config + "simulation_config": recommendation_simulation_config, + "description_simulation": recommendation_description_simulation } output.append(recommendation) @@ -474,8 +490,10 @@ class HeatingRecommender: # No recommendation needed return + new_heating_description = "Electric storage heaters, radiators" + # Set up artefacts, suitable for the simulation and regardless of controls - heating_ending_config = MainHeatAttributes("Electric storage heaters, radiators").process() + heating_ending_config = MainHeatAttributes(new_heating_description).process() heating_simulation_config = check_simulation_difference( new_config=heating_ending_config, old_config=self.property.main_heating ) @@ -497,9 +515,15 @@ class HeatingRecommender: ) description = "Install high heat retention electric storage heaters" + heating_description_simulation = { + "mainheat-description": new_heating_description, + "mainheat-energy-eff": heating_simulation_config["mainheat_energy_eff_ending"], + } + recommendations = self.combine_heating_and_controls( controls_recommendations=controls_recommender.recommendation, heating_simulation_config=heating_simulation_config, + heating_description_simulation=heating_description_simulation, costs=costs, description=description, phase=phase,