From 39b04799c8ec4c2fa74ab4468ef89550e40aebfd Mon Sep 17 00:00:00 2001 From: Luke Hoersten Date: Sun, 21 Jun 2026 11:16:18 -0500 Subject: scrypted: log attachListener early-return when no camera assigned MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Silent early-return at 'if (!v.cameraId) return;' makes a brand-new viewport with no camera selected look identical (in the console) to one that subscribed successfully — there's no positive or negative signal until you try to fire a camera event. After observing a fresh viewport produce zero output on a doorbell press, switching the early-return to a warning that says 'no camera assigned — open Settings and pick a camera; subscription skipped' so the missing configuration becomes self-evident. --- scrypted/scrypted-viewport.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scrypted') diff --git a/scrypted/scrypted-viewport.ts b/scrypted/scrypted-viewport.ts index 2662ff1..7d64ffd 100644 --- a/scrypted/scrypted-viewport.ts +++ b/scrypted/scrypted-viewport.ts @@ -655,9 +655,12 @@ class ScryptedViewportProvider extends ScryptedDeviceBase }; private attachListener(v: Viewport) { - if (!v.cameraId) return; - const cam = systemManager.getDeviceById(v.cameraId); const tag = v.name || v.storage.getItem("display_name") || v.nativeId; + if (!v.cameraId) { + this.console.warn(`viewport "${tag}": no camera assigned — open Settings and pick a camera; subscription skipped`); + return; + } + const cam = systemManager.getDeviceById(v.cameraId); if (!cam) { this.console.warn(`viewport "${tag}": camera ${v.cameraId} not found`); return; -- cgit v1.2.3