2024-12-15 14:40:03 +01:00
|
|
|
from typing import List, Optional
|
|
|
|
|
|
|
|
from pydantic import Field
|
|
|
|
|
|
|
|
from akkudoktoreos.config.configabc import SettingsBaseModel
|
2025-01-05 14:41:07 +01:00
|
|
|
from akkudoktoreos.core.logging import get_logger
|
2024-12-15 14:40:03 +01:00
|
|
|
|
|
|
|
logger = get_logger(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
class OptimizationCommonSettings(SettingsBaseModel):
|
2025-01-15 00:54:45 +01:00
|
|
|
"""General Optimization Configuration.
|
2024-12-15 14:40:03 +01:00
|
|
|
|
|
|
|
Attributes:
|
2025-01-18 14:26:34 +01:00
|
|
|
hours (int): Number of hours for optimizations.
|
2024-12-15 14:40:03 +01:00
|
|
|
"""
|
|
|
|
|
2025-01-18 14:26:34 +01:00
|
|
|
hours: Optional[int] = Field(
|
2025-01-12 05:19:37 +01:00
|
|
|
default=48, ge=0, description="Number of hours into the future for optimizations."
|
2024-12-15 14:40:03 +01:00
|
|
|
)
|
|
|
|
|
2025-01-18 14:26:34 +01:00
|
|
|
penalty: Optional[int] = Field(default=10, description="Penalty factor used in optimization.")
|
2024-12-15 14:40:03 +01:00
|
|
|
|
2025-01-18 14:26:34 +01:00
|
|
|
ev_available_charge_rates_percent: Optional[List[float]] = Field(
|
2024-12-15 14:40:03 +01:00
|
|
|
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.",
|
|
|
|
)
|