minor bug fix with solar

This commit is contained in:
Khalim Conn-Kowlessar 2025-09-24 00:26:46 +01:00
parent e410e8d9c8
commit 754644a857

View file

@ -854,18 +854,21 @@ class GoogleSolarApi:
): ):
continue continue
solar_api_client = cls(api_key=google_solar_api_key, solar_materials=solar_materials)
if unit["longitude"] is None or unit["latitude"] is None: if unit["longitude"] is None or unit["latitude"] is None:
# At this point, we've checked that solar PV is valid, and so we provide some defaults # At this point, we've checked that solar PV is valid, and so we provide some defaults
property_instance.set_solar_panel_configuration( property_instance.set_solar_panel_configuration(
solar_panel_configuration={ solar_panel_configuration={
"insights_data": None, "insights_data": None,
"panel_performance": cls.default_panel_performance(property_instance=property_instance), "panel_performance": solar_api_client.default_panel_performance(
property_instance=property_instance
),
"unit_share_of_energy": 1 "unit_share_of_energy": 1
}, },
) )
continue continue
solar_api_client = cls(api_key=google_solar_api_key, solar_materials=solar_materials)
solar_api_client.get( solar_api_client.get(
longitude=unit["longitude"], longitude=unit["longitude"],
latitude=unit["latitude"], latitude=unit["latitude"],