mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Updating heating recommender to recommend heating controls, with the heating change
This commit is contained in:
parent
606fd3a615
commit
6942414951
2 changed files with 13 additions and 14 deletions
|
|
@ -108,17 +108,16 @@ async def trigger_plan(body: PlanTriggerRequest):
|
|||
property_id, is_new = create_property(
|
||||
session, body.portfolio_id, epc_searcher.address_clean, epc_searcher.postcode_clean, epc_searcher.uprn
|
||||
)
|
||||
# if a new record was not created, we don't produduce recommendations
|
||||
# if not is_new:
|
||||
# continue
|
||||
#
|
||||
# create_property_targets(
|
||||
# session,
|
||||
# property_id=property_id,
|
||||
# portfolio_id=body.portfolio_id,
|
||||
# epc_target=body.goal_value,
|
||||
# heat_demand_target=None
|
||||
# )
|
||||
if not is_new:
|
||||
continue
|
||||
|
||||
create_property_targets(
|
||||
session,
|
||||
property_id=property_id,
|
||||
portfolio_id=body.portfolio_id,
|
||||
epc_target=body.goal_value,
|
||||
heat_demand_target=None
|
||||
)
|
||||
|
||||
epc_records = {
|
||||
'original_epc': epc_searcher.newest_epc.copy(),
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class HeatingRecommender:
|
|||
|
||||
if has_boiler or no_heating_has_mains or electic_heating_has_mains:
|
||||
# This indicates that the home previously did not have a boiler in place and so would require
|
||||
# an overhaul to the system
|
||||
# an overhaul to the system - right now, this is all reasons, apart from if there is an existing boiler
|
||||
system_change = not has_boiler
|
||||
self.recommend_boiler_upgrades(phase=phase, system_change=system_change)
|
||||
|
||||
|
|
@ -353,8 +353,8 @@ class HeatingRecommender:
|
|||
if not controls_recommender.recommendation:
|
||||
return
|
||||
|
||||
if no_heating_has_mains:
|
||||
# We combine the heating and controls recommendations
|
||||
if system_change:
|
||||
# We combine the heating and controls recommendations, in the case of a system change
|
||||
boiler_recommendation = self.recommendations[0].copy()
|
||||
combined_recommendations = []
|
||||
for controls_recommendation in controls_recommender.recommendation:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue