mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Merge pull request #532 from Hestia-Homes/eco-eligiblity-bug
fixed find my epc fetch bug getting heating control instead of heating system
This commit is contained in:
commit
84dbec3cd3
2 changed files with 6 additions and 1 deletions
|
|
@ -663,7 +663,6 @@ async def model_engine(body: PlanTriggerRequest):
|
|||
input_properties = OpenUprnClient.set_spatial_data(input_properties, bucket_name=get_settings().DATA_BUCKET)
|
||||
|
||||
[p.set_features(cleaned=cleaned, kwh_client=kwh_client, kwh_predictions=kwh_preds) for p in input_properties]
|
||||
|
||||
# TODO: If a property is semi-detached, we might get roof surfaces for the main building + the neighbour
|
||||
# TODO: If we can't get high image quality, should we use the solar API? Maybe just for semi-detached units with
|
||||
# extensions, since it doesn't seem to do a great job
|
||||
|
|
|
|||
|
|
@ -73,6 +73,12 @@ class RetrieveFindMyEpc:
|
|||
def get_feature_row_text(feature_name, index=0):
|
||||
matches = [row for row in rows if row.find("th") and feature_name in row.find("th").text]
|
||||
if len(matches) > index:
|
||||
# A commonly seen case is when feature_name is Main heating and we want to make sure we get
|
||||
# main heating and not main heating control
|
||||
if feature_name == "Main heating":
|
||||
matches = [
|
||||
row for row in matches if row.find("th") and row.find("th").text.strip() == "Main heating"
|
||||
]
|
||||
cells = matches[index].find_all("td")
|
||||
description = self.get_text(cells[0])
|
||||
rating = self.get_text(cells[1])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue