working on ashp recommendations

This commit is contained in:
Khalim Conn-Kowlessar 2024-05-03 16:08:14 +01:00
parent 7ec795f5bb
commit f21221d721

View file

@ -123,11 +123,28 @@ class Recommendations:
self.heating_recommender.heating_recommendations or
self.heating_recommender.heating_control_recommendations
):
if self.heating_recommender.heating_recommendations:
property_recommendations.append(self.heating_recommender.heating_recommendations)
if self.heating_recommender.heating_control_recommendations:
property_recommendations.append(self.heating_recommender.heating_control_recommendations)
# We split into first and second phase recommendations
first_phase_recommendations = [
r for r in (
self.heating_recommender.heating_recommendations +
self.heating_recommender.heating_control_recommendations
)
if r["phase"] == phase
]
second_phase_recommendations = [
r for r in (
self.heating_recommender.heating_recommendations +
self.heating_recommender.heating_control_recommendations
)
if r["phase"] == phase + 1
]
if first_phase_recommendations:
property_recommendations.append(first_phase_recommendations)
if second_phase_recommendations:
property_recommendations.append(second_phase_recommendations)
# We check if we have distinct heating and heating controls recommendations
# If so, we increment by 2 (one of the heating system, one for the heating controls)