diff --git a/frigate/app.py b/frigate/app.py index b9c279d42..146db30d5 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -29,6 +29,7 @@ from frigate.const import ( ) from frigate.object_detection import ObjectDetectProcess from frigate.events.cleanup import EventCleanup +from frigate.events.external import ExternalEventProcessor from frigate.events.maintainer import EventProcessor from frigate.http import create_app from frigate.log import log_process, root_configurer @@ -205,6 +206,9 @@ class FrigateApp: self.config, self.camera_metrics, self.detectors, self.processes ) + def init_external_event_processor(self) -> None: + self.event_processor = ExternalEventProcessor(self.config, self.event_queue) + def init_web_server(self) -> None: self.flask_app = create_app( self.config, @@ -213,6 +217,7 @@ class FrigateApp: self.detected_frames_processor, self.storage_maintainer, self.onvif_controller, + self.event_processor, self.plus_api, ) @@ -437,6 +442,7 @@ class FrigateApp: self.start_camera_capture_processes() self.start_storage_maintainer() self.init_stats() + self.init_external_event_processor() self.init_web_server() self.start_timeline_processor() self.start_event_processor() diff --git a/frigate/http.py b/frigate/http.py index a7755ee54..ff67feb64 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -34,7 +34,7 @@ from playhouse.shortcuts import model_to_dict from frigate.config import FrigateConfig from frigate.const import CLIPS_DIR, MAX_SEGMENT_DURATION, RECORD_DIR from frigate.models import Event, Recordings, Timeline -from frigate.events_manual import create_manual_event, finish_manual_event +from frigate.events.external import ExternalEventProcessor from frigate.object_processing import TrackedObject from frigate.plus import PlusApi from frigate.ptz import OnvifController @@ -62,6 +62,7 @@ def create_app( detected_frames_processor, storage_maintainer: StorageMaintainer, onvif: OnvifController, + external_processor: ExternalEventProcessor, plus_api: PlusApi, ): app = Flask(__name__)