forked from Github/frigate
Refactor events to be more generic (#6320)
* Organize event table to be more generalized * Add appropriate fields to data * Move tracked object logic to own function * Add source type to event queue * rename enum * Fix types that are used in webUI * remove redundant * Formatting * fix typing * Rename enum
This commit is contained in:
@@ -4,9 +4,8 @@ import logging
|
||||
import threading
|
||||
import queue
|
||||
|
||||
from enum import Enum
|
||||
|
||||
from frigate.config import FrigateConfig
|
||||
from frigate.events import EventTypeEnum
|
||||
from frigate.models import Timeline
|
||||
|
||||
from multiprocessing.queues import Queue
|
||||
@@ -17,12 +16,6 @@ from frigate.util import to_relative_box
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class TimelineSourceEnum(str, Enum):
|
||||
# api = "api"
|
||||
# audio = "audio"
|
||||
tracked_object = "tracked_object"
|
||||
|
||||
|
||||
class TimelineProcessor(threading.Thread):
|
||||
"""Handle timeline queue and update DB."""
|
||||
|
||||
@@ -51,7 +44,7 @@ class TimelineProcessor(threading.Thread):
|
||||
except queue.Empty:
|
||||
continue
|
||||
|
||||
if input_type == TimelineSourceEnum.tracked_object:
|
||||
if input_type == EventTypeEnum.tracked_object:
|
||||
self.handle_object_detection(
|
||||
camera, event_type, prev_event_data, event_data
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user