mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Merge pull request #391 from Hestia-Homes/remote-assessment-api
enable patching via remote assessment
This commit is contained in:
commit
8d65f5b1e0
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 we have a remote assment data type, we pull the additional data and include it
|
||||||
if body.event_type == "remote_assessment":
|
if body.event_type == "remote_assessment":
|
||||||
logger.info("Retrieving find my epc data")
|
logger.info("Retrieving find my epc data")
|
||||||
property_non_invasive_recommendations = RetrieveFindMyEpc.get_from_epc(
|
for k in ["address", "address1"]:
|
||||||
epc_searcher.newest_epc
|
epc_searcher.newest_epc[k] = epc_searcher.address_clean
|
||||||
)
|
|
||||||
# TODO: We need to determine if we should make a patch, if the EPC is new
|
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)
|
epc_records = patch_epc(patch, epc_records)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -477,4 +477,13 @@ class RetrieveFindMyEpc:
|
||||||
"recommendations": find_epc_data["recommendations"],
|
"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