feat: add bidding zone to energy charts price prediction (#765)

Energy charts supports bidding zones. Allow to specifiy the bidding zone in the configuration.

Extend and simplify ElecPrice configuration structure and setup config migration to automatically
update the configuration file.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
Bobby Noelte
2025-11-16 13:26:18 +01:00
committed by GitHub
parent edff649a5e
commit 4c2997dbd6
9 changed files with 177 additions and 122 deletions

View File

@@ -4,6 +4,9 @@ from pydantic import Field, field_validator
from akkudoktoreos.config.configabc import SettingsBaseModel
from akkudoktoreos.prediction.elecpriceabc import ElecPriceProvider
from akkudoktoreos.prediction.elecpriceenergycharts import (
ElecPriceEnergyChartsCommonSettings,
)
from akkudoktoreos.prediction.elecpriceimport import ElecPriceImportCommonSettings
from akkudoktoreos.prediction.prediction import get_prediction
@@ -17,15 +20,6 @@ elecprice_providers = [
]
class ElecPriceCommonProviderSettings(SettingsBaseModel):
"""Electricity Price Prediction Provider Configuration."""
ElecPriceImport: Optional[ElecPriceImportCommonSettings] = Field(
default=None,
json_schema_extra={"description": "ElecPriceImport settings", "examples": [None]},
)
class ElecPriceCommonSettings(SettingsBaseModel):
"""Electricity Price Prediction Configuration."""
@@ -53,17 +47,14 @@ class ElecPriceCommonSettings(SettingsBaseModel):
},
)
provider_settings: ElecPriceCommonProviderSettings = Field(
default_factory=ElecPriceCommonProviderSettings,
json_schema_extra={
"description": "Provider settings",
"examples": [
# Example 1: Empty/default settings (all providers None)
{
"ElecPriceImport": None,
},
],
},
elecpriceimport: ElecPriceImportCommonSettings = Field(
default_factory=ElecPriceImportCommonSettings,
json_schema_extra={"description": "Import provider settings."},
)
energycharts: ElecPriceEnergyChartsCommonSettings = Field(
default_factory=ElecPriceEnergyChartsCommonSettings,
json_schema_extra={"description": "Energy Charts provider settings."},
)
# Validators