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:
Nicolas Mowen
2026-03-19 16:39:28 -06:00
committed by GitHub
parent c6991db432
commit cedcbdba07
6 changed files with 185 additions and 28 deletions

View File

@@ -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

View File

@@ -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