mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-11-13 09:13:30 +01:00
fix: provider settings in top level field of configuration (#1161)
Configuration for some providers was given in the sub-field `provider_settings` combining the settings of several providers. Pydantic does not understand this very well and the configuration became cumbersome, especially in EOSdash. All provider settings from the `provider-settings` sub-field are now lifted to the top level field of the configuration. The changes are automatically migrated in the configuration. Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
@@ -67,16 +67,16 @@ class PVForecastImport(PVForecastProvider, PredictionImportProvider):
|
||||
async def _update_data(self, force_update: Optional[bool] = False) -> None:
|
||||
# Both _sequence_lock and _record_lock are already held by the caller.
|
||||
# Use internal sync methods only — never await public async counterparts.
|
||||
if self.config.pvforecast.provider_settings.PVForecastImport is None:
|
||||
if self.config.pvforecast.pvforecastimport is None:
|
||||
logger.debug(f"{self.provider_id()} data update without provider settings.")
|
||||
return
|
||||
if self.config.pvforecast.provider_settings.PVForecastImport.import_file_path is not None:
|
||||
if self.config.pvforecast.pvforecastimport.import_file_path is not None:
|
||||
await self._import_from_file(
|
||||
self.config.pvforecast.provider_settings.PVForecastImport.import_file_path,
|
||||
self.config.pvforecast.pvforecastimport.import_file_path,
|
||||
key_prefix="pvforecast",
|
||||
)
|
||||
if self.config.pvforecast.provider_settings.PVForecastImport.import_json is not None:
|
||||
if self.config.pvforecast.pvforecastimport.import_json is not None:
|
||||
await self._import_from_json(
|
||||
self.config.pvforecast.provider_settings.PVForecastImport.import_json,
|
||||
self.config.pvforecast.pvforecastimport.import_json,
|
||||
key_prefix="pvforecast",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user