mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-02 17:12:16 +03:00
Toggle review alerts and detections (#16482)
* backend * frontend * docs * fix topic name and initial websocket state * update reference config * fix mqtt docs * fix initial topics * don't apply max severity when alerts/detections are disabled * fix ws merge * tweaks
This commit is contained in:
@@ -72,18 +72,27 @@ class TrackedObject:
|
||||
def max_severity(self) -> Optional[str]:
|
||||
review_config = self.camera_config.review
|
||||
|
||||
if self.obj_data["label"] in review_config.alerts.labels and (
|
||||
not review_config.alerts.required_zones
|
||||
or set(self.entered_zones) & set(review_config.alerts.required_zones)
|
||||
if (
|
||||
self.camera_config.review.alerts.enabled
|
||||
and self.obj_data["label"] in review_config.alerts.labels
|
||||
and (
|
||||
not review_config.alerts.required_zones
|
||||
or set(self.entered_zones) & set(review_config.alerts.required_zones)
|
||||
)
|
||||
):
|
||||
return SeverityEnum.alert
|
||||
|
||||
if (
|
||||
not review_config.detections.labels
|
||||
or self.obj_data["label"] in review_config.detections.labels
|
||||
) and (
|
||||
not review_config.detections.required_zones
|
||||
or set(self.entered_zones) & set(review_config.detections.required_zones)
|
||||
self.camera_config.review.detections.enabled
|
||||
and (
|
||||
not review_config.detections.labels
|
||||
or self.obj_data["label"] in review_config.detections.labels
|
||||
)
|
||||
and (
|
||||
not review_config.detections.required_zones
|
||||
or set(self.entered_zones)
|
||||
& set(review_config.detections.required_zones)
|
||||
)
|
||||
):
|
||||
return SeverityEnum.detection
|
||||
|
||||
|
||||
Reference in New Issue
Block a user