diff --git a/backend/Property.py b/backend/Property.py index 3cc8350d..5507876a 100644 --- a/backend/Property.py +++ b/backend/Property.py @@ -1279,9 +1279,11 @@ class Property: """ exclusions = [] if exclusions is None else exclusions + if "air_source_heat_pump" in exclusions: + return self.current_energy_consumption # If the property currently has an ASHP, we don't gain from any efficiency improvements - if not self.is_ashp_valid(exclusions=exclusions): + if not self.is_ashp_valid(measures=["air_source_heat_pump"]): return self.current_energy_consumption # If the property currently has an electric boiler, it will still benefit from the ASHP efficiency gain diff --git a/recommendations/LightingRecommendations.py b/recommendations/LightingRecommendations.py index 1186b0a9..b9456f8d 100644 --- a/recommendations/LightingRecommendations.py +++ b/recommendations/LightingRecommendations.py @@ -66,6 +66,11 @@ class LightingRecommendations: if self.property.lighting["low_energy_proportion"] == 100: return + leds_recommendation_config = next( + (r for r in self.property.non_invasive_recommendations if r["type"] == "low_energy_lighting"), + {} + ) + number_lighting_outlets = self.property.number_lighting_outlets # Number non lel outlets @@ -79,6 +84,9 @@ class LightingRecommendations: return # Get the cost of the fittings + if leds_recommendation_config.get("cost"): + raise NotImplementedError("Costs from for low energy lighting have not been implemented") + cost_result = self.costs.low_energy_lighting( number_of_lights=number_non_lel_outlets, number_current_lel_lights=number_lighting_outlets - number_non_lel_outlets, @@ -97,6 +105,12 @@ class LightingRecommendations: cost_result = override_costs(cost_result) description = "Low energy lighting has already been installed, no further action required" + if leds_recommendation_config.get("sap_points") is not None: + # This could be zero points + sap_points = leds_recommendation_config["sap_points"] + else: + sap_points = round(2 * (number_non_lel_outlets / number_lighting_outlets), 2) + self.recommendation = [ { "phase": phase, @@ -108,13 +122,14 @@ class LightingRecommendations: "already_installed": already_installed, # For SAP points, we use the fact that lighting is usually worth 2 points and we scale this to # the proportion of lights that will be set to low energy - "sap_points": round(2 * (number_non_lel_outlets / number_lighting_outlets), 2), + "sap_points": sap_points, "kwh_savings": heat_demand_change, "co2_equivalent_savings": carbon_change, "description_simulation": { "lighting-energy-eff": "Very Good", "lighting-description": "Low energy lighting in all fixed outlets", }, - **cost_result + **cost_result, + "survey": leds_recommendation_config.get("survey", False) } ] diff --git a/recommendations/Recommendations.py b/recommendations/Recommendations.py index 609fd245..184f0240 100644 --- a/recommendations/Recommendations.py +++ b/recommendations/Recommendations.py @@ -73,9 +73,6 @@ class Recommendations: Determines the set of measures to be included in recommendations """ - if self.property_instance.non_invasive_recommendations: - raise Exception("IMPLEMENT ME") - # Generally, inclusions is a global option and will overrule specific property non-invasive recommendations. # This is done so that we can use inclusions to specify scenarios.