add missing global shapshots config

This commit is contained in:
Blake Blackshear 2021-01-14 06:38:13 -06:00
parent 232fa1ffe8
commit 14a5118b4d

View File

@ -454,6 +454,19 @@ class ClipsConfig():
'retain': self.retain.to_dict() 'retain': self.retain.to_dict()
} }
class SnapshotsConfig():
def __init__(self, config):
self._retain = RetainConfig(config['retain'], config['retain'])
@property
def retain(self):
return self._retain
def to_dict(self):
return {
'retain': self.retain.to_dict()
}
class RecordConfig(): class RecordConfig():
def __init__(self, global_config, config): def __init__(self, global_config, config):
self._enabled = config.get('enabled', global_config['enabled']) self._enabled = config.get('enabled', global_config['enabled'])
@ -972,6 +985,7 @@ class FrigateConfig():
self._detectors = { name: DetectorConfig(d) for name, d in config['detectors'].items() } self._detectors = { name: DetectorConfig(d) for name, d in config['detectors'].items() }
self._mqtt = MqttConfig(config['mqtt']) self._mqtt = MqttConfig(config['mqtt'])
self._clips = ClipsConfig(config['clips']) self._clips = ClipsConfig(config['clips'])
self._snapshots = SnapshotsConfig(config['clips'])
self._cameras = { name: CameraConfig(name, c, config) for name, c in config['cameras'].items() } self._cameras = { name: CameraConfig(name, c, config) for name, c in config['cameras'].items() }
self._logger = LoggerConfig(config['logger']) self._logger = LoggerConfig(config['logger'])
@ -1005,6 +1019,7 @@ class FrigateConfig():
'detectors': {k: d.to_dict() for k, d in self.detectors.items()}, 'detectors': {k: d.to_dict() for k, d in self.detectors.items()},
'mqtt': self.mqtt.to_dict(), 'mqtt': self.mqtt.to_dict(),
'clips': self.clips.to_dict(), 'clips': self.clips.to_dict(),
'snapshots': self.snapshots.to_dict(),
'cameras': {k: c.to_dict() for k, c in self.cameras.items()}, 'cameras': {k: c.to_dict() for k, c in self.cameras.items()},
'logger': self.logger.to_dict() 'logger': self.logger.to_dict()
} }
@ -1033,6 +1048,10 @@ class FrigateConfig():
def clips(self): def clips(self):
return self._clips return self._clips
@property
def snapshots(self):
return self._snapshots
@property @property
def cameras(self) -> Dict[str, CameraConfig]: def cameras(self) -> Dict[str, CameraConfig]:
return self._cameras return self._cameras