mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
handle recommendations for insulated room roof
This commit is contained in:
parent
e50d82ac24
commit
996c71c189
4 changed files with 19 additions and 12 deletions
|
|
@ -123,7 +123,8 @@ class GoogleSolarApi:
|
|||
|
||||
:param longitude: The longitude of the location.
|
||||
:param latitude: The latitude of the location.
|
||||
:param energy_consumption: The energy consumption of the building/unit associated to the longitude and latitude.
|
||||
:param energy_consumption: The energy consumption of the building/unit associated to the longitude and latitude,
|
||||
that we wish to size the solar panels up against
|
||||
:param property_instance: The property instance associated to the longitude and latitude.
|
||||
:param required_quality: The required quality of the data (default is "MEDIUM").
|
||||
:param is_building: Whether the energy consumption is for a building or a unit.
|
||||
|
|
@ -266,7 +267,7 @@ class GoogleSolarApi:
|
|||
cost = cost_instance.solar_pv(
|
||||
wattage=wattage, has_battery=False
|
||||
)["total"]
|
||||
|
||||
|
||||
roi_summary.append(
|
||||
{
|
||||
"segmentIndex": segment["segmentIndex"],
|
||||
|
|
|
|||
|
|
@ -93,11 +93,19 @@ class RoofRecommendations:
|
|||
Check if the room roof is already insulated
|
||||
"""
|
||||
|
||||
return (
|
||||
full_insulated_room_roof = (
|
||||
self.property.roof["is_roof_room"] and
|
||||
self.property.roof["insulation_thickness"] in ["average", "above_average"]
|
||||
)
|
||||
|
||||
room_roof_insulated_at_rafters = (
|
||||
self.property.roof["is_pitched"] and
|
||||
self.property.roof["is_at_rafters"] and
|
||||
self.property.roof["insulation_thickness"] in ["average", "above_average"]
|
||||
)
|
||||
|
||||
return full_insulated_room_roof or room_roof_insulated_at_rafters
|
||||
|
||||
def recommend(self, phase):
|
||||
|
||||
if self.property.roof["has_dwelling_above"]:
|
||||
|
|
|
|||
|
|
@ -174,10 +174,6 @@ class SolarPvRecommendations:
|
|||
if already_installed:
|
||||
cost_result = override_costs(cost_result)
|
||||
|
||||
# We calculate the photo_supply we're going to simulate the impact with and we round this to the
|
||||
# nearest 5
|
||||
photo_supply = round(roof_coverage_percent / 5) * 5
|
||||
|
||||
self.recommendation.append(
|
||||
{
|
||||
"phase": phase,
|
||||
|
|
@ -192,9 +188,9 @@ class SolarPvRecommendations:
|
|||
# This is required for simulating the SAP impact. solar_pv_percentage is between 0 & 1 so we
|
||||
# scale
|
||||
# back up here
|
||||
"photo_supply": photo_supply,
|
||||
"photo_supply": roof_coverage_percent,
|
||||
"has_battery": has_battery,
|
||||
"initial_ac_kwh_per_year": recommendation_config["initial_ac_kwh_per_year"],
|
||||
"description_simulation": {"photo-supply": photo_supply},
|
||||
"description_simulation": {"photo-supply": roof_coverage_percent},
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -205,10 +205,11 @@ def get_wall_u_value(
|
|||
return float(mapped_value)
|
||||
|
||||
|
||||
def get_u_value_from_s9(thickness, s9, is_loft, is_roof_room, is_thatched):
|
||||
def get_u_value_from_s9(thickness, s9, is_loft, is_roof_room, is_thatched, is_at_rafters):
|
||||
"""Get the U-value from table S9 based on the insulation thickness."""
|
||||
|
||||
if is_roof_room:
|
||||
# If the roof as pitched & insulated at the rafters, it's a room roof
|
||||
if is_roof_room or is_at_rafters:
|
||||
# We re-map the thickness
|
||||
thickness_map = {
|
||||
"below average": "50",
|
||||
|
|
@ -219,7 +220,7 @@ def get_u_value_from_s9(thickness, s9, is_loft, is_roof_room, is_thatched):
|
|||
thickness = thickness_map[thickness]
|
||||
|
||||
if thickness in ["below average", "average", "above average", "none", None] or (
|
||||
not is_loft and not is_roof_room
|
||||
not is_loft and not is_roof_room and not is_at_rafters
|
||||
):
|
||||
return None
|
||||
elif thickness.endswith("+"):
|
||||
|
|
@ -291,6 +292,7 @@ def get_roof_u_value(
|
|||
is_loft=is_loft,
|
||||
is_roof_room=is_roof_room,
|
||||
is_thatched=is_thatched,
|
||||
is_at_rafters=is_at_rafters
|
||||
)
|
||||
|
||||
if u_value is not None:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue