mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-19 09:27:06 +03:00
don't apply max severity when alerts/detections are disabled
This commit is contained in:
parent
a138f0e732
commit
fc1a69c51e
@ -184,7 +184,7 @@ class EventProcessor(threading.Thread):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# keep these from being set back to false because the event
|
# keep these from being set back to false because the event
|
||||||
# may have started while recordings and snapshots were enabled
|
# may have started while recordings/snapshots/alerts/detections were enabled
|
||||||
# this would be an issue for long running events
|
# this would be an issue for long running events
|
||||||
if self.events_in_process[event_data["id"]]["has_clip"]:
|
if self.events_in_process[event_data["id"]]["has_clip"]:
|
||||||
event_data["has_clip"] = True
|
event_data["has_clip"] = True
|
||||||
@ -199,7 +199,9 @@ class EventProcessor(threading.Thread):
|
|||||||
Event.end_time: end_time,
|
Event.end_time: end_time,
|
||||||
Event.zones: list(event_data["entered_zones"]),
|
Event.zones: list(event_data["entered_zones"]),
|
||||||
Event.thumbnail: event_data["thumbnail"],
|
Event.thumbnail: event_data["thumbnail"],
|
||||||
Event.has_clip: event_data["has_clip"],
|
Event.has_clip: event_data["has_clip"]
|
||||||
|
if event_data.get("max_severity")
|
||||||
|
else False,
|
||||||
Event.has_snapshot: event_data["has_snapshot"],
|
Event.has_snapshot: event_data["has_snapshot"],
|
||||||
Event.model_hash: first_detector.model.model_hash,
|
Event.model_hash: first_detector.model.model_hash,
|
||||||
Event.model_type: first_detector.model.model_type,
|
Event.model_type: first_detector.model.model_type,
|
||||||
|
|||||||
@ -64,18 +64,27 @@ class TrackedObject:
|
|||||||
def max_severity(self) -> Optional[str]:
|
def max_severity(self) -> Optional[str]:
|
||||||
review_config = self.camera_config.review
|
review_config = self.camera_config.review
|
||||||
|
|
||||||
if self.obj_data["label"] in review_config.alerts.labels and (
|
if (
|
||||||
|
self.camera_config.review.alerts.enabled
|
||||||
|
and self.obj_data["label"] in review_config.alerts.labels
|
||||||
|
and (
|
||||||
not review_config.alerts.required_zones
|
not review_config.alerts.required_zones
|
||||||
or set(self.entered_zones) & set(review_config.alerts.required_zones)
|
or set(self.entered_zones) & set(review_config.alerts.required_zones)
|
||||||
|
)
|
||||||
):
|
):
|
||||||
return SeverityEnum.alert
|
return SeverityEnum.alert
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
self.camera_config.review.detections.enabled
|
||||||
|
and (
|
||||||
not review_config.detections.labels
|
not review_config.detections.labels
|
||||||
or self.obj_data["label"] in review_config.detections.labels
|
or self.obj_data["label"] in review_config.detections.labels
|
||||||
) and (
|
)
|
||||||
|
and (
|
||||||
not review_config.detections.required_zones
|
not review_config.detections.required_zones
|
||||||
or set(self.entered_zones) & set(review_config.detections.required_zones)
|
or set(self.entered_zones)
|
||||||
|
& set(review_config.detections.required_zones)
|
||||||
|
)
|
||||||
):
|
):
|
||||||
return SeverityEnum.detection
|
return SeverityEnum.detection
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user