mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-19 23:08:08 +02:00
Add ability to toggle camera features via API (#22538)
* Refactor profile to be a generic state setter API * Add tool to chat * Cleanup * Cleanup
This commit is contained in:
@@ -128,7 +128,7 @@ export default function GeneralSettings({ className }: GeneralSettingsProps) {
|
||||
|
||||
const handleActivateProfile = async (profileName: string | null) => {
|
||||
try {
|
||||
await axios.put("profile/set", { profile: profileName || null });
|
||||
await axios.put("camera/*/set/profile", { value: profileName ?? "none" });
|
||||
await updateProfiles();
|
||||
toast.success(
|
||||
profileName
|
||||
|
||||
@@ -207,8 +207,8 @@ export default function ProfilesView({
|
||||
async (profile: string | null) => {
|
||||
setActivating(true);
|
||||
try {
|
||||
await axios.put("profile/set", {
|
||||
profile: profile || null,
|
||||
await axios.put("camera/*/set/profile", {
|
||||
value: profile ?? "none",
|
||||
});
|
||||
await updateProfiles();
|
||||
toast.success(
|
||||
@@ -244,7 +244,7 @@ export default function ProfilesView({
|
||||
try {
|
||||
// If this profile is active, deactivate it first
|
||||
if (activeProfile === deleteProfile) {
|
||||
await axios.put("profile/set", { profile: null });
|
||||
await axios.put("camera/*/set/profile", { value: "none" });
|
||||
}
|
||||
|
||||
// Remove the profile from all cameras and the top-level definition
|
||||
|
||||
Reference in New Issue
Block a user