diff --git a/frigate/config.py b/frigate/config.py index 6d0342d98..6190413a7 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -1171,12 +1171,20 @@ class LoggerConfig(FrigateBaseModel): class CameraGroupConfig(FrigateBaseModel): """Represents a group of cameras.""" - cameras: list[str] = Field( + cameras: Union[str, List[str]] = Field( default_factory=list, title="List of cameras in this group." ) icon: str = Field(default="generic", title="Icon that represents camera group.") order: int = Field(default=0, title="Sort order for group.") + @field_validator("cameras", mode="before") + @classmethod + def validate_cameras(cls, v): + if isinstance(v, str) and "," not in v: + return [v] + + return v + def verify_config_roles(camera_config: CameraConfig) -> None: """Verify that roles are setup in the config correctly.""" diff --git a/web/src/components/filter/CameraGroupSelector.tsx b/web/src/components/filter/CameraGroupSelector.tsx index 54320f29a..d9fc9f420 100644 --- a/web/src/components/filter/CameraGroupSelector.tsx +++ b/web/src/components/filter/CameraGroupSelector.tsx @@ -555,9 +555,7 @@ export function CameraGroupEdit({ message: "Invalid camera group name.", }), - cameras: z.array(z.string()).min(2, { - message: "You must select at least two cameras.", - }), + cameras: z.array(z.string()), icon: z .string() .min(1, { message: "You must select an icon." })