Skip to content

Commit

Permalink
Rename enum
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Apr 30, 2023
1 parent ca90946 commit bbc2c77
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions frigate/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
logger = logging.getLogger(__name__)


class DetectionTypeEnum(str, Enum):
class EventTypeEnum(str, Enum):
# api = "api"
# audio = "audio"
tracked_object = "tracked_object"
Expand Down Expand Up @@ -91,7 +91,7 @@ def run(self) -> None:
)
)

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
Expand Down
8 changes: 4 additions & 4 deletions frigate/object_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
FrigateConfig,
)
from frigate.const import CLIPS_DIR
from frigate.events import DetectionTypeEnum
from frigate.events import EventTypeEnum
from frigate.util import (
SharedMemoryFrameManager,
calculate_region,
Expand Down Expand Up @@ -658,7 +658,7 @@ def __init__(

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):
Expand All @@ -674,7 +674,7 @@ def update(camera, obj: TrackedObject, current_frame_time):
obj.previous = after
self.event_queue.put(
(
DetectionTypeEnum.tracked_object,
EventTypeEnum.tracked_object,
"update",
camera,
obj.to_dict(include_thumbnail=True),
Expand Down Expand Up @@ -732,7 +732,7 @@ def end(camera, obj: TrackedObject, current_frame_time):

self.event_queue.put(
(
DetectionTypeEnum.tracked_object,
EventTypeEnum.tracked_object,
"end",
camera,
obj.to_dict(include_thumbnail=True),
Expand Down
4 changes: 2 additions & 2 deletions frigate/timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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
Expand Down Expand Up @@ -44,7 +44,7 @@ def run(self) -> None:
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
)
Expand Down

0 comments on commit bbc2c77

Please sign in to comment.