From 1a1cf80d7efcd5691641e40208fa7d50938db787 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 7 Sep 2023 15:40:55 +0300 Subject: [PATCH] added welsh translation to MainHeatControlAttributes --- model_data/epc_attributes/MainheatControlAttributes.py | 9 +++++++++ .../test_data/test_mainheat_control_attributes_cases.py | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/model_data/epc_attributes/MainheatControlAttributes.py b/model_data/epc_attributes/MainheatControlAttributes.py index d4282276..b5f35031 100644 --- a/model_data/epc_attributes/MainheatControlAttributes.py +++ b/model_data/epc_attributes/MainheatControlAttributes.py @@ -72,10 +72,19 @@ class MainheatControlAttributes(Definitions): "celect control": 'celect-type control' } + WELSH_TEXT = { + "rhaglennydd, dim thermostat ystafell": "programmer, no room thermostat" + } + def __init__(self, description: str): self.description: str = clean_description(description.lower()) 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 + # Remap remapped = self.TO_REMAP.get(self.description) if remapped: diff --git a/model_data/tests/test_data/test_mainheat_control_attributes_cases.py b/model_data/tests/test_data/test_mainheat_control_attributes_cases.py index 4869ba1a..692049bf 100644 --- a/model_data/tests/test_data/test_mainheat_control_attributes_cases.py +++ b/model_data/tests/test_data/test_mainheat_control_attributes_cases.py @@ -131,6 +131,10 @@ mainheat_control_cases = [ {'original_description': 'Celect controls', 'thermostatic_control': 'celect-type control', 'charging_system': None, 'switch_system': None, 'no_control': None, 'dhw_control': None, 'community_heating': None, 'multiple_room_thermostats': False, 'auxiliary_systems': None, + 'trvs': None}, + {'original_description': 'Rhaglennydd, dim thermostat ystafell', + 'thermostatic_control': 'room thermostat', 'charging_system': None, + 'switch_system': "programmer", 'no_control': None, + 'dhw_control': None, 'community_heating': None, 'multiple_room_thermostats': False, 'auxiliary_systems': None, 'trvs': None} - ]