From 499f70cfd3135254c4c233bed5239507aaaff743 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Wed, 1 May 2024 09:08:10 -0500 Subject: [PATCH] config validation fixes (#11191) --- frigate/config.py | 6 +++--- web/src/components/filter/CameraGroupSelector.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frigate/config.py b/frigate/config.py index d7ee147f3..0d5c9fb47 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -518,7 +518,7 @@ class ZoneConfig(BaseModel): ge=0, title="Number of seconds that an object must loiter to be considered in the zone.", ) - objects: List[str] = Field( + objects: Union[str, List[str]] = Field( default_factory=list, title="List of objects that can trigger the zone.", ) @@ -616,7 +616,7 @@ class AlertsConfig(FrigateBaseModel): labels: List[str] = Field( default=DEFAULT_ALERT_OBJECTS, title="Labels to create alerts for." ) - required_zones: List[str] = Field( + required_zones: Union[str, List[str]] = Field( default_factory=list, title="List of required zones to be entered in order to save the event as an alert.", ) @@ -636,7 +636,7 @@ class DetectionsConfig(FrigateBaseModel): labels: Optional[List[str]] = Field( default=None, title="Labels to create detections for." ) - required_zones: List[str] = Field( + required_zones: Union[str, List[str]] = Field( default_factory=list, title="List of required zones to be entered in order to save the event as a detection.", ) diff --git a/web/src/components/filter/CameraGroupSelector.tsx b/web/src/components/filter/CameraGroupSelector.tsx index 651a4ca5a..3b9b3e20f 100644 --- a/web/src/components/filter/CameraGroupSelector.tsx +++ b/web/src/components/filter/CameraGroupSelector.tsx @@ -485,7 +485,7 @@ export function CameraGroupEdit({ ? currentGroups.length + 1 : editingGroup[1].order; - const orderQuery = `camera_groups.${values.name}.order=${order}`; + const orderQuery = `camera_groups.${values.name}.order=${+order}`; const iconQuery = `camera_groups.${values.name}.icon=${values.icon}`; const cameraQueries = values.cameras .map((cam) => `&camera_groups.${values.name}.cameras=${cam}`)