diff --git a/solaredge2mqtt/service/forecast.py b/solaredge2mqtt/service/forecast.py index 08652fc..eab6e96 100644 --- a/solaredge2mqtt/service/forecast.py +++ b/solaredge2mqtt/service/forecast.py @@ -14,8 +14,7 @@ from sklearn.compose import ColumnTransformer from sklearn.ensemble import HistGradientBoostingRegressor from sklearn.inspection import permutation_importance -from sklearn.model_selection import (GridSearchCV, TimeSeriesSplit, - train_test_split) +from sklearn.model_selection import GridSearchCV, TimeSeriesSplit, train_test_split from sklearn.pipeline import Pipeline from solaredge2mqtt.exceptions import InvalidDataException @@ -24,8 +23,7 @@ from solaredge2mqtt.mqtt import MQTTClient from solaredge2mqtt.service.influxdb import InfluxDB, Point from solaredge2mqtt.service.weather import WeatherClient -from solaredge2mqtt.settings import (LOCAL_TZ, ForecastSettings, - LocationSettings) +from solaredge2mqtt.settings import LOCAL_TZ, ForecastSettings, LocationSettings class ForecasterType(EnumModel): @@ -175,6 +173,7 @@ async def forecast_loop(self): ] data = DataFrame(estimation_data_list) + data["time"] = data["time"].astype(f"datetime64[ns, {LOCAL_TZ}]") for typed, forecaster in self.forecasters.items(): predicted_data = await forecaster.predict(data)