forked from Github/frigate
Write default config if no config is saved (#10847)
This commit is contained in:
@@ -281,6 +281,32 @@ def find_by_key(dictionary, target_key):
|
||||
return None
|
||||
|
||||
|
||||
def save_default_config(location: str):
|
||||
try:
|
||||
with open(location, "w") as f:
|
||||
f.write(
|
||||
"""
|
||||
mqtt:
|
||||
enabled: False
|
||||
|
||||
cameras:
|
||||
name_of_your_camera: # <------ Name the camera
|
||||
enabled: True
|
||||
ffmpeg:
|
||||
inputs:
|
||||
- path: rtsp://10.0.10.10:554/rtsp # <----- The stream you want to use for detection
|
||||
roles:
|
||||
- detect
|
||||
detect:
|
||||
enabled: False # <---- disable detection until you have a working camera feed
|
||||
width: 1280
|
||||
height: 720
|
||||
"""
|
||||
)
|
||||
except PermissionError:
|
||||
logger.error("Unable to write default config to /config")
|
||||
|
||||
|
||||
def get_tomorrow_at_time(hour: int) -> datetime.datetime:
|
||||
"""Returns the datetime of the following day at 2am."""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user