mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-07-12 21:08:13 +00:00
fix: pydantic extra keywords deprecated (#753)
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>
This commit is contained in:
@@ -70,13 +70,17 @@ class PredictionCommonSettings(SettingsBaseModel):
|
||||
"""
|
||||
|
||||
hours: Optional[int] = Field(
|
||||
default=48, ge=0, description="Number of hours into the future for predictions"
|
||||
default=48,
|
||||
ge=0,
|
||||
json_schema_extra={"description": "Number of hours into the future for predictions"},
|
||||
)
|
||||
|
||||
historic_hours: Optional[int] = Field(
|
||||
default=48,
|
||||
ge=0,
|
||||
description="Number of hours into the past for historical predictions data",
|
||||
json_schema_extra={
|
||||
"description": "Number of hours into the past for historical predictions data"
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@@ -107,7 +111,9 @@ class Prediction(PredictionContainer):
|
||||
WeatherClearOutside,
|
||||
WeatherImport,
|
||||
]
|
||||
] = Field(default_factory=list, description="List of prediction providers")
|
||||
] = Field(
|
||||
default_factory=list, json_schema_extra={"description": "List of prediction providers"}
|
||||
)
|
||||
|
||||
|
||||
# Initialize forecast providers, all are singletons.
|
||||
|
||||
Reference in New Issue
Block a user