mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-20 07:08:23 +03:00
Add config migration
This commit is contained in:
parent
3093a7a594
commit
feba94b202
@ -8,6 +8,7 @@ from typing import Any, Optional, Union
|
|||||||
|
|
||||||
from ruamel.yaml import YAML
|
from ruamel.yaml import YAML
|
||||||
|
|
||||||
|
from frigate.config.camera.genai import GenAIRoleEnum
|
||||||
from frigate.const import CONFIG_DIR, EXPORT_DIR
|
from frigate.const import CONFIG_DIR, EXPORT_DIR
|
||||||
from frigate.util.services import get_video_properties
|
from frigate.util.services import get_video_properties
|
||||||
|
|
||||||
@ -438,6 +439,17 @@ def migrate_018_0(config: dict[str, dict[str, Any]]) -> dict[str, dict[str, Any]
|
|||||||
"""Handle migrating frigate config to 0.18-0"""
|
"""Handle migrating frigate config to 0.18-0"""
|
||||||
new_config = config.copy()
|
new_config = config.copy()
|
||||||
|
|
||||||
|
# Migrate GenAI to new format
|
||||||
|
genai = new_config.get("genai")
|
||||||
|
|
||||||
|
if genai and genai.get("provider"):
|
||||||
|
genai["roles"] = [
|
||||||
|
GenAIRoleEnum.embeddings,
|
||||||
|
GenAIRoleEnum.vision,
|
||||||
|
GenAIRoleEnum.tools,
|
||||||
|
]
|
||||||
|
new_config["genai"] = {"default": genai}
|
||||||
|
|
||||||
# Remove deprecated sync_recordings from global record config
|
# Remove deprecated sync_recordings from global record config
|
||||||
if new_config.get("record", {}).get("sync_recordings") is not None:
|
if new_config.get("record", {}).get("sync_recordings") is not None:
|
||||||
del new_config["record"]["sync_recordings"]
|
del new_config["record"]["sync_recordings"]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user