mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 02:35:22 +03:00
Rename enum
This commit is contained in:
parent
ca90946e2e
commit
bbc2c7743d
@ -22,7 +22,7 @@ from typing import Dict
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class DetectionTypeEnum(str, Enum):
|
||||
class EventTypeEnum(str, Enum):
|
||||
# api = "api"
|
||||
# audio = "audio"
|
||||
tracked_object = "tracked_object"
|
||||
@ -91,7 +91,7 @@ class EventProcessor(threading.Thread):
|
||||
)
|
||||
)
|
||||
|
||||
if source_type == DetectionTypeEnum.tracked_object:
|
||||
if source_type == EventTypeEnum.tracked_object:
|
||||
if event_type == "start":
|
||||
self.events_in_process[event_data["id"]] = event_data
|
||||
continue
|
||||
|
||||
@ -21,7 +21,7 @@ from frigate.config import (
|
||||
FrigateConfig,
|
||||
)
|
||||
from frigate.const import CLIPS_DIR
|
||||
from frigate.events import DetectionTypeEnum
|
||||
from frigate.events import EventTypeEnum
|
||||
from frigate.util import (
|
||||
SharedMemoryFrameManager,
|
||||
calculate_region,
|
||||
@ -658,7 +658,7 @@ class TrackedObjectProcessor(threading.Thread):
|
||||
|
||||
def start(camera, obj: TrackedObject, current_frame_time):
|
||||
self.event_queue.put(
|
||||
(DetectionTypeEnum.tracked_object, "start", camera, obj.to_dict())
|
||||
(EventTypeEnum.tracked_object, "start", camera, obj.to_dict())
|
||||
)
|
||||
|
||||
def update(camera, obj: TrackedObject, current_frame_time):
|
||||
@ -674,7 +674,7 @@ class TrackedObjectProcessor(threading.Thread):
|
||||
obj.previous = after
|
||||
self.event_queue.put(
|
||||
(
|
||||
DetectionTypeEnum.tracked_object,
|
||||
EventTypeEnum.tracked_object,
|
||||
"update",
|
||||
camera,
|
||||
obj.to_dict(include_thumbnail=True),
|
||||
@ -732,7 +732,7 @@ class TrackedObjectProcessor(threading.Thread):
|
||||
|
||||
self.event_queue.put(
|
||||
(
|
||||
DetectionTypeEnum.tracked_object,
|
||||
EventTypeEnum.tracked_object,
|
||||
"end",
|
||||
camera,
|
||||
obj.to_dict(include_thumbnail=True),
|
||||
|
||||
@ -5,7 +5,7 @@ import threading
|
||||
import queue
|
||||
|
||||
from frigate.config import FrigateConfig
|
||||
from frigate.events import DetectionTypeEnum
|
||||
from frigate.events import EventTypeEnum
|
||||
from frigate.models import Timeline
|
||||
|
||||
from multiprocessing.queues import Queue
|
||||
@ -44,7 +44,7 @@ class TimelineProcessor(threading.Thread):
|
||||
except queue.Empty:
|
||||
continue
|
||||
|
||||
if input_type == DetectionTypeEnum.tracked_object:
|
||||
if input_type == EventTypeEnum.tracked_object:
|
||||
self.handle_object_detection(
|
||||
camera, event_type, prev_event_data, event_data
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user