pull in current config version into default config

This commit is contained in:
Josh Hawkins 2025-12-24 08:09:14 -06:00
parent bf01852197
commit 8b7cc127bf

View File

@ -28,6 +28,7 @@ from frigate.util.builtin import (
get_ffmpeg_arg_list, get_ffmpeg_arg_list,
) )
from frigate.util.config import ( from frigate.util.config import (
CURRENT_CONFIG_VERSION,
StreamInfoRetriever, StreamInfoRetriever,
convert_area_to_pixels, convert_area_to_pixels,
find_config_file, find_config_file,
@ -76,11 +77,12 @@ logger = logging.getLogger(__name__)
yaml = YAML() yaml = YAML()
DEFAULT_CONFIG = """ DEFAULT_CONFIG = f"""
mqtt: mqtt:
enabled: False enabled: False
cameras: {} # No cameras defined, UI wizard should be used cameras: {{}} # No cameras defined, UI wizard should be used
version: {CURRENT_CONFIG_VERSION}
""" """
DEFAULT_DETECTORS = {"cpu": {"type": "cpu"}} DEFAULT_DETECTORS = {"cpu": {"type": "cpu"}}
@ -753,8 +755,7 @@ class FrigateConfig(FrigateBaseModel):
if new_config and f.tell() == 0: if new_config and f.tell() == 0:
f.write(DEFAULT_CONFIG) f.write(DEFAULT_CONFIG)
logger.info( logger.info(
"Created default config file, see the getting started docs \ "Created default config file, see the getting started docs for configuration: https://docs.frigate.video/guides/getting_started"
for configuration https://docs.frigate.video/guides/getting_started"
) )
f.seek(0) f.seek(0)