mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-11 02:47:37 +03:00
add enabled config to zones
This commit is contained in:
parent
9128881924
commit
e9aebbe53f
@ -197,6 +197,10 @@ class CameraState:
|
|||||||
|
|
||||||
if draw_options.get("zones"):
|
if draw_options.get("zones"):
|
||||||
for name, zone in self.camera_config.zones.items():
|
for name, zone in self.camera_config.zones.items():
|
||||||
|
# skip disabled zones
|
||||||
|
if not zone.enabled:
|
||||||
|
continue
|
||||||
|
|
||||||
thickness = (
|
thickness = (
|
||||||
8
|
8
|
||||||
if any(
|
if any(
|
||||||
|
|||||||
@ -18,6 +18,10 @@ class ZoneConfig(BaseModel):
|
|||||||
title="Zone name",
|
title="Zone name",
|
||||||
description="A user-friendly name for the zone, displayed in the Frigate UI. If not set, a formatted version of the zone name will be used.",
|
description="A user-friendly name for the zone, displayed in the Frigate UI. If not set, a formatted version of the zone name will be used.",
|
||||||
)
|
)
|
||||||
|
enabled: bool = Field(
|
||||||
|
default=True,
|
||||||
|
title="Whether this zone is active. Disabled zones are ignored at runtime.",
|
||||||
|
)
|
||||||
filters: dict[str, FilterConfig] = Field(
|
filters: dict[str, FilterConfig] = Field(
|
||||||
default_factory=dict,
|
default_factory=dict,
|
||||||
title="Zone filters",
|
title="Zone filters",
|
||||||
|
|||||||
@ -188,6 +188,10 @@ class TrackedObject:
|
|||||||
|
|
||||||
# check each zone
|
# check each zone
|
||||||
for name, zone in self.camera_config.zones.items():
|
for name, zone in self.camera_config.zones.items():
|
||||||
|
# skip disabled zones
|
||||||
|
if not zone.enabled:
|
||||||
|
continue
|
||||||
|
|
||||||
# if the zone is not for this object type, skip
|
# if the zone is not for this object type, skip
|
||||||
if len(zone.objects) > 0 and obj_data["label"] not in zone.objects:
|
if len(zone.objects) > 0 and obj_data["label"] not in zone.objects:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user