Add ability to toggle camera features via API (#22538)
CI / ARM Extra Build (push) Blocked by required conditions
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions

* 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 17:39:28 -05:00
committed by GitHub
parent c6991db432
commit cedcbdba07
6 changed files with 185 additions and 28 deletions
+1 -1
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
+3 -3
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