handle the case of no hhr heater recommendation

This commit is contained in:
Khalim Conn-Kowlessar 2024-06-04 10:05:05 +01:00
parent 9284d6cf76
commit 813d51e9f3

View file

@ -244,10 +244,16 @@ class Mds:
recs = self.heating_recommender.recommend_hhr_storage_heaters(
phase=phase, system_change=True, heating_controls_only=False, _return=True
)
recs = self.insert_recommendation_id(recs, measures, "high_heat_retention_storage_heaters")
mds_recommendations.append(recs)
if self.optimise_measures and len(recs):
phase += 1
if recs is None:
logger.info(
f"No recommendations for high heat retention storage heaters, current heating "
f"{self.property_instance.main_heating['clean_description']}"
)
else:
recs = self.insert_recommendation_id(recs, measures, "high_heat_retention_storage_heaters")
mds_recommendations.append(recs)
if self.optimise_measures and len(recs):
phase += 1
if "low_energy_lighting" in measure_config_list:
raise Exception("check me out 9")