From 470abbab9d0c4ad6024a574f3d60325172f32aaf Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 9 Jun 2026 16:24:16 -0500 Subject: [PATCH] tweaks --- web/e2e/specs/settings/camera-wizard-ptz.spec.ts | 14 ++++++++++++++ web/public/locales/en/views/settings.json | 2 +- .../settings/wizard/Step3StreamConfig.tsx | 4 +++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/web/e2e/specs/settings/camera-wizard-ptz.spec.ts b/web/e2e/specs/settings/camera-wizard-ptz.spec.ts index 6e4deec83e..008337cf1a 100644 --- a/web/e2e/specs/settings/camera-wizard-ptz.spec.ts +++ b/web/e2e/specs/settings/camera-wizard-ptz.spec.ts @@ -148,6 +148,20 @@ test.describe("Camera wizard PTZ pane @medium @mobile", () => { ).toBeDisabled(); }); + test("shows the pane but leaves the switch off when no presets are found", async ({ + frigateApp, + }) => { + await mockProbe(frigateApp.page, { ...PTZ_PROBE, presets_count: 0 }); + const dialog = await gotoStep3(frigateApp.page); + + await expect( + dialog.getByText("Enable PTZ Controls", { exact: true }), + ).toBeVisible(); + await expect(ptzSwitch(dialog)).not.toBeChecked(); + // with the switch off, the connection fields are not shown + await expect(dialog.getByPlaceholder("192.168.1.100")).toHaveCount(0); + }); + test("hides the PTZ pane when the probe reports no PTZ support", async ({ frigateApp, }) => { diff --git a/web/public/locales/en/views/settings.json b/web/public/locales/en/views/settings.json index 46e7e41a3a..11c0a1f994 100644 --- a/web/public/locales/en/views/settings.json +++ b/web/public/locales/en/views/settings.json @@ -406,7 +406,7 @@ }, "ptz": { "title": "Enable PTZ Controls", - "detectedNote": "PTZ support has been detected via ONVIF.", + "detectedNote": "PTZ support has been detected via ONVIF. If this is a PTZ camera, enabling this option will allow you to control the camera's pan/tilt/zoom functions from the UI.", "connectionDetails": "ONVIF connection details", "host": "ONVIF Host", "port": "ONVIF Port", diff --git a/web/src/components/settings/wizard/Step3StreamConfig.tsx b/web/src/components/settings/wizard/Step3StreamConfig.tsx index d157c6f890..3c0a8ac406 100644 --- a/web/src/components/settings/wizard/Step3StreamConfig.tsx +++ b/web/src/components/settings/wizard/Step3StreamConfig.tsx @@ -78,6 +78,7 @@ export default function Step3StreamConfig({ const onvif = wizardData.onvif; const ptzSupported = wizardData.probeResult?.ptz_supported === true; + const hasPresets = (wizardData.probeResult?.presets_count ?? 0) > 0; const onvifInvalid = !!onvif?.enabled && (!onvif.host?.trim() || !onvif.port); // Seed the PTZ pane once from the successful ONVIF probe @@ -86,7 +87,7 @@ export default function Step3StreamConfig({ if (ptzSupported && wizardData.onvif === undefined) { onUpdate({ onvif: { - enabled: true, + enabled: hasPresets, host: wizardData.host ?? "", port: wizardData.onvifPort ?? 8000, user: wizardData.username ?? "", @@ -96,6 +97,7 @@ export default function Step3StreamConfig({ } }, [ ptzSupported, + hasPresets, wizardData.onvif, wizardData.host, wizardData.onvifPort,