mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
handled bug for dual primary heating
This commit is contained in:
parent
1fda0dc237
commit
38eaa52e6c
1 changed files with 9 additions and 1 deletions
|
|
@ -93,7 +93,7 @@ class Property:
|
|||
self.data = {
|
||||
k.replace("_", "-"): v for k, v in epc_record.get("prepared_epc").items()
|
||||
}
|
||||
|
||||
|
||||
self.old_data = epc_record.get("old_data")
|
||||
self.property_dimensions = None
|
||||
# This is a list of measures that have already been installed in the property, typically found as a result
|
||||
|
|
@ -1181,6 +1181,14 @@ class Property:
|
|||
self.heating_energy_source = list({
|
||||
fuel for key, fuel in heating_fuel_mapping.items() if self.main_heating.get(key, False)
|
||||
})
|
||||
|
||||
if set(self.heating_energy_source) == {'Electricity', 'Natural Gas'}:
|
||||
# It means they have mixed heating so we take the primary one, based on main fuel
|
||||
if self.main_fuel["clean_description"] == "Mains gas not community":
|
||||
self.heating_energy_source = ['Natural Gas']
|
||||
else:
|
||||
self.heating_energy_source = ['Electricity']
|
||||
|
||||
if len(self.heating_energy_source) == 0 or len(self.heating_energy_source) > 1:
|
||||
raise Exception("Investigate me")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue