api_v1.4/utils/misc.py

29 lines
886 B
Python
Raw Normal View History

"""
Miscellaneous
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Project Author Peter Yefi peteryefi@gmail.com
"""
hp_models = {
'air_source': ['012', '015', '018', '023', '030', '033', '037', '044', '047', '057', '070', '087', '097', '102',
'120', '130', '140'],
'water_to_water': ['ClimateMaster 156 kW', 'ClimateMaster 256 kW', 'ClimateMaster 335 kW']
}
def validate_hp_model(hp_type: str, model: str) -> bool:
"""
Validates the HP model parameter provided by users
for running insel simulation
:param hp_type: the type of heat pump: air source or
water to water
:param model: the model of heat pump
:return: bool
"""
if 'air' in hp_type.lower():
if model in hp_models['air_source']:
return True
elif 'water' in hp_type.lower():
if model in hp_models['water_to_water']:
return True
return False