mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-04-19 08:55:15 +00:00
* All config now nested. - Use default config from model field default values. If providers should be enabled by default, non-empty default config file could be provided again. - Environment variable support with EOS_ prefix and __ between levels, e.g. EOS_SERVER__EOS_SERVER_PORT=8503 where all values are case insensitive. For more information see: https://docs.pydantic.dev/latest/concepts/pydantic_settings/#parsing-environment-variable-values - Use devices as registry for configured devices. DeviceBase as base class with for now just initializion support (in the future expand to operations during optimization). - Strip down ConfigEOS to the only configuration instance. Reload from file or reset to defaults is possible. * Fix multi-initialization of derived SingletonMixin classes.
43 lines
1.1 KiB
Python
43 lines
1.1 KiB
Python
from typing import List, Optional
|
|
|
|
from pydantic import Field
|
|
|
|
from akkudoktoreos.config.configabc import SettingsBaseModel
|
|
from akkudoktoreos.core.logging import get_logger
|
|
|
|
logger = get_logger(__name__)
|
|
|
|
|
|
class OptimizationCommonSettings(SettingsBaseModel):
|
|
"""Base configuration for optimization settings.
|
|
|
|
Attributes:
|
|
optimization_hours (int): Number of hours for optimizations.
|
|
"""
|
|
|
|
optimization_hours: Optional[int] = Field(
|
|
default=48, ge=0, description="Number of hours into the future for optimizations."
|
|
)
|
|
|
|
optimization_penalty: Optional[int] = Field(
|
|
default=10, description="Penalty factor used in optimization."
|
|
)
|
|
|
|
optimization_ev_available_charge_rates_percent: Optional[List[float]] = Field(
|
|
default=[
|
|
0.0,
|
|
6.0 / 16.0,
|
|
# 7.0 / 16.0,
|
|
8.0 / 16.0,
|
|
# 9.0 / 16.0,
|
|
10.0 / 16.0,
|
|
# 11.0 / 16.0,
|
|
12.0 / 16.0,
|
|
# 13.0 / 16.0,
|
|
14.0 / 16.0,
|
|
# 15.0 / 16.0,
|
|
1.0,
|
|
],
|
|
description="Charge rates available for the EV in percent of maximum charge.",
|
|
)
|