mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
37 lines
1.3 KiB
Python
37 lines
1.3 KiB
Python
from recommendations.Costs import Costs
|
|
|
|
|
|
class SolarPvRecommendations:
|
|
|
|
def __init__(self, property_instance):
|
|
"""
|
|
:param property_instance: Instance of the Property class, for the home associated to property_id
|
|
:param photo_supply_lookup: Lookup table of photo supply percentages
|
|
"""
|
|
|
|
self.property = property_instance
|
|
self.costs = Costs(self.property)
|
|
|
|
self.recommendations = []
|
|
|
|
def recommend(self):
|
|
"""
|
|
We check if a property is potentially suitable for solar PV based on the following criteria:
|
|
- The property is a house or bungalow
|
|
- The property has a flat or pitched roof
|
|
- The property does not have existing solar pv
|
|
:return:
|
|
"""
|
|
|
|
is_valid_property_type = self.property.data["property-type"] in ["House", "Bungalow"]
|
|
is_valid_roof_type = (
|
|
self.property.roof["is_flat"] or self.property.roof["is_pitched"] or self.property.roof["is_roof_room"]
|
|
)
|
|
has_no_existing_solar_pv = not self.property.data["photo-supply"] in [
|
|
None, 0, self.property.DATA_ANOMALY_MATCHES
|
|
]
|
|
|
|
if not is_valid_property_type or not is_valid_roof_type or has_no_existing_solar_pv:
|
|
return
|
|
|
|
# We now have a property which is potentially suitable for solar PV
|