mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-11-25 06:46:25 +00:00
Pydantic deprecates using extra keyword arguments on Field. Used json_schema_extra instead. Deprecated in Pydantic V2.0 to be removed in V3.0. Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
47 lines
1.1 KiB
Python
47 lines
1.1 KiB
Python
"""Settings for energy management.
|
|
|
|
Kept in an extra module to avoid cyclic dependencies on package import.
|
|
"""
|
|
|
|
from enum import Enum
|
|
from typing import Optional
|
|
|
|
from pydantic import Field
|
|
|
|
from akkudoktoreos.config.configabc import SettingsBaseModel
|
|
|
|
|
|
class EnergyManagementMode(str, Enum):
|
|
"""Energy management mode."""
|
|
|
|
PREDICTION = "PREDICTION"
|
|
OPTIMIZATION = "OPTIMIZATION"
|
|
|
|
|
|
class EnergyManagementCommonSettings(SettingsBaseModel):
|
|
"""Energy Management Configuration."""
|
|
|
|
startup_delay: float = Field(
|
|
default=5,
|
|
ge=1,
|
|
json_schema_extra={
|
|
"description": "Startup delay in seconds for EOS energy management runs."
|
|
},
|
|
)
|
|
|
|
interval: Optional[float] = Field(
|
|
default=None,
|
|
json_schema_extra={
|
|
"description": "Intervall in seconds between EOS energy management runs.",
|
|
"examples": ["300"],
|
|
},
|
|
)
|
|
|
|
mode: Optional[EnergyManagementMode] = Field(
|
|
default=None,
|
|
json_schema_extra={
|
|
"description": "Energy management mode [OPTIMIZATION | PREDICTION].",
|
|
"examples": ["OPTIMIZATION", "PREDICTION"],
|
|
},
|
|
)
|