adding solar hot water and wind turbine features

This commit is contained in:
Khalim Conn-Kowlessar 2023-08-01 11:49:26 +01:00
parent 6f579b6939
commit 4c99a9308b
2 changed files with 41 additions and 3 deletions

View file

@ -41,6 +41,8 @@ class Property(BaseUtility):
self.energy = None
self.ventilation = None
self.solar_pv = None
self.solar_hot_water = None
self.wind_turbine = None
if epc_client:
self.epc_client = epc_client
@ -144,6 +146,40 @@ class Property(BaseUtility):
"solar_pv": solar_pv,
}
def set_solar_hot_water(self):
"""
Extracts and formats data about the home's solar hot water
We are just formatting the solar-water-heating-flag in the epc data
:return:
"""
value_map = {
"Y": True,
"N": False,
"": None,
}
self.solar_hot_water = {
"solar_hot_water": value_map[self.data["solar-water-heating-flag"]],
}
def set_wind_turbine(self):
"""
Extracts and formats data about the home's wind turbine
We are just formatting the wind-turbine-flag in the epc data
:return:
"""
wind_turbine_count = self.data["wind-turbine-count"]
if wind_turbine_count == "":
wind_turbine_count = None
else:
wind_turbine_count = int(wind_turbine_count)
self.wind_turbine = {
"wind_turbine": wind_turbine_count,
}
def get_components(self, cleaned):
"""
Given the cleaning that has been performed, we'll use this to identify the property
@ -161,6 +197,8 @@ class Property(BaseUtility):
self.set_energy()
self.set_ventilation()
self.set_solar_pv()
self.set_solar_hot_water()
self.set_wind_turbine()
for description, attribute in cleaned.items():

View file

@ -259,9 +259,9 @@ async def trigger_plan(body: PlanTriggerRequest):
"lighting": p.lighting["cleaned_description"],
"lighting_rating": rating_lookup[p.data["lighting-energy-eff"]],
"ventilation": p.ventilation["ventilation"],
"solar_pv": p.solar_pv["cleaned_description"],
"solar_hot_water": p.solar_hot_water["cleaned_description"],
"wind_turbine": p.wind_turbine["cleaned_description"],
"solar_pv": p.solar_pv["solar_pv"],
"solar_hot_water": p.solar_hot_water["solar_hot_water"],
"wind_turbine": p.wind_turbine["wind_turbine"],
"floor_height": p.data["floor-height"],
"heat_loss_corridor": p.data["heat-loss-corridor"],
"unheated_corridor_length": p.data["unheated-corridor-length"],