mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-06 11:15:21 +03:00
Refactor audio event detection and HTTP event creation to use constants and enums respectively
This commit is contained in:
parent
7c629c1874
commit
7b40390826
@ -199,7 +199,7 @@ class AudioEventMaintainer(threading.Thread):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if score > dict((self.config.audio.filters or {}).get(label, {})).get(
|
if score > dict((self.config.audio.filters or {}).get(label, {})).get(
|
||||||
"threshold", 0.8
|
"threshold", AUDIO_MIN_CONFIDENCE
|
||||||
):
|
):
|
||||||
self.handle_detection(label, score)
|
self.handle_detection(label, score)
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,7 @@ from frigate.const import (
|
|||||||
RECORD_DIR,
|
RECORD_DIR,
|
||||||
)
|
)
|
||||||
from frigate.events.external import ExternalEventProcessor
|
from frigate.events.external import ExternalEventProcessor
|
||||||
|
from frigate.events.maintainer import EventTypeEnum
|
||||||
from frigate.models import Event, Recordings, Timeline
|
from frigate.models import Event, Recordings, Timeline
|
||||||
from frigate.object_processing import TrackedObject
|
from frigate.object_processing import TrackedObject
|
||||||
from frigate.plus import PlusApi
|
from frigate.plus import PlusApi
|
||||||
@ -903,7 +904,7 @@ def create_event(camera_name, label):
|
|||||||
event_id = current_app.external_processor.create_manual_event(
|
event_id = current_app.external_processor.create_manual_event(
|
||||||
camera_name,
|
camera_name,
|
||||||
label,
|
label,
|
||||||
json.get("source_type", "api"),
|
json.get("source_type", EventTypeEnum.api),
|
||||||
json.get("sub_label", None),
|
json.get("sub_label", None),
|
||||||
json.get("score", 0),
|
json.get("score", 0),
|
||||||
json.get("duration", 30),
|
json.get("duration", 30),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user