mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
enable patching via remote assessment
This commit is contained in:
parent
a28c669d0b
commit
9e179e7f9b
2 changed files with 15 additions and 5 deletions
|
|
@ -520,10 +520,11 @@ async def trigger_plan(body: PlanTriggerRequest):
|
|||
# if we have a remote assment data type, we pull the additional data and include it
|
||||
if body.event_type == "remote_assessment":
|
||||
logger.info("Retrieving find my epc data")
|
||||
property_non_invasive_recommendations = RetrieveFindMyEpc.get_from_epc(
|
||||
epc_searcher.newest_epc
|
||||
)
|
||||
# TODO: We need to determine if we should make a patch, if the EPC is new
|
||||
for k in ["address", "address1"]:
|
||||
epc_searcher.newest_epc[k] = epc_searcher.address_clean
|
||||
|
||||
property_non_invasive_recommendations, patch = RetrieveFindMyEpc.get_from_epc(epc_searcher.newest_epc)
|
||||
# If we have a property type, this means when we pull the epc data, we might need to make a patch
|
||||
|
||||
epc_records = patch_epc(patch, epc_records)
|
||||
|
||||
|
|
|
|||
|
|
@ -477,4 +477,13 @@ class RetrieveFindMyEpc:
|
|||
"recommendations": find_epc_data["recommendations"],
|
||||
}
|
||||
|
||||
return non_invasive_recommendations
|
||||
# We need to add the patch information
|
||||
patch = {
|
||||
"current-energy-rating": find_epc_data["current_epc_rating"],
|
||||
"current-energy-efficiency": find_epc_data["current_epc_efficiency"],
|
||||
"potential-energy-rating": find_epc_data["potential_epc_rating"],
|
||||
"potential-energy-efficiency": find_epc_data["potential_epc_efficiency"],
|
||||
**find_epc_data["epc_data"],
|
||||
}
|
||||
|
||||
return non_invasive_recommendations, patch
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue