mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Fixing Hotwater attributes class and adding additional tests
This commit is contained in:
parent
99ea438490
commit
07224393bc
2 changed files with 19 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ class HotWaterAttributes(BaseUtility):
|
||||||
# A device that transfers heat from a source (like the ground or air) into a building to provide hot water
|
# A device that transfers heat from a source (like the ground or air) into a building to provide hot water
|
||||||
'electric immersion', # An electric device that heats water using electric resistance
|
'electric immersion', # An electric device that heats water using electric resistance
|
||||||
'gas boiler', # A boiler that uses gas as fuel to heat water
|
'gas boiler', # A boiler that uses gas as fuel to heat water
|
||||||
|
'oil boiler', # A boiler that uses oil as fuel to heat water
|
||||||
'electric instantaneous', # Similar to gas instantaneous, but uses electricity as its energy source
|
'electric instantaneous', # Similar to gas instantaneous, but uses electricity as its energy source
|
||||||
'gas multipoint', # A gas water heater that can supply hot water to multiple points of use at once
|
'gas multipoint', # A gas water heater that can supply hot water to multiple points of use at once
|
||||||
'heat pump' # A general category for heat pumps, regardless of the energy source
|
'heat pump' # A general category for heat pumps, regardless of the energy source
|
||||||
|
|
@ -89,11 +90,21 @@ class HotWaterAttributes(BaseUtility):
|
||||||
'from second main heating system': 'from secondary system',
|
'from second main heating system': 'from secondary system',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WELSH_TEXT = {
|
||||||
|
"ogçör brif system": "from main system",
|
||||||
|
}
|
||||||
|
|
||||||
def __init__(self, description: str):
|
def __init__(self, description: str):
|
||||||
self.description: str = clean_description(description.lower())
|
self.description: str = clean_description(description.lower())
|
||||||
|
|
||||||
self.nodata = not description or description in self.DATA_ANOMALY_MATCHES
|
self.nodata = not description or description in self.DATA_ANOMALY_MATCHES
|
||||||
|
|
||||||
|
translation = self.WELSH_TEXT.get(self.description)
|
||||||
|
|
||||||
|
if translation:
|
||||||
|
self.nodata = False
|
||||||
|
self.description = translation
|
||||||
|
|
||||||
if not any(
|
if not any(
|
||||||
self._keyword_in_description(keywords)
|
self._keyword_in_description(keywords)
|
||||||
for keywords in [
|
for keywords in [
|
||||||
|
|
|
||||||
|
|
@ -125,5 +125,13 @@ hotwater_cases = [
|
||||||
'system_type': 'from secondary system',
|
'system_type': 'from secondary system',
|
||||||
'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None,
|
'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None,
|
||||||
'extra_features': None, 'chp_systems': None, 'distribution_system': None, 'no_system_present': None,
|
'extra_features': None, 'chp_systems': None, 'distribution_system': None, 'no_system_present': None,
|
||||||
|
'assumed': False, "appliance": None},
|
||||||
|
{'original_description': 'OGÇÖr brif system', 'heater_type': None, 'system_type': 'from main system',
|
||||||
|
'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None,
|
||||||
|
'extra_features': None, 'chp_systems': None, 'distribution_system': None, 'no_system_present': None,
|
||||||
|
'assumed': False, "appliance": None},
|
||||||
|
{'original_description': 'Oil boiler/circulator', 'heater_type': None, 'system_type': 'oil boiler',
|
||||||
|
'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None,
|
||||||
|
'extra_features': None, 'chp_systems': None, 'distribution_system': 'circulator', 'no_system_present': None,
|
||||||
'assumed': False, "appliance": None}
|
'assumed': False, "appliance": None}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue