EMS, Akku + erster Testfall (test.py)

This commit is contained in:
Bla Bla
2024-02-18 14:32:27 +01:00
parent 0d45ebac5f
commit b227a9c642
4 changed files with 168 additions and 0 deletions

View File

@@ -54,6 +54,18 @@ class PVForecast:
def get_forecast_data(self):
return self.forecast_data
def get_forecast_for_date(self, input_date_str):
input_date = datetime.strptime(input_date_str, "%Y-%m-%d")
daily_forecast_obj = [data for data in self.forecast_data if datetime.strptime(data.get_date_time(), "%Y-%m-%dT%H:%M:%S.%f%z").date() == input_date.date()]
daily_forecast = []
for d in daily_forecast_obj:
daily_forecast.append(d.get_ac_power())
return np.array(daily_forecast)
# Beispiel für die Verwendung der Klasse