src.nth.io/

summaryrefslogtreecommitdiff
path: root/scrypted
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-06-21 11:16:18 -0500
committerLuke Hoersten <[email protected]>2026-06-21 11:16:18 -0500
commit39b04799c8ec4c2fa74ab4468ef89550e40aebfd (patch)
treeb9ea408f133ebb025d9bb965c2f4e3129bd98a5f /scrypted
parent796bc17cea7ee8d74e03b9eeb266bedf89240fc3 (diff)
scrypted: log attachListener early-return when no camera assigned
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.
Diffstat (limited to 'scrypted')
-rw-r--r--scrypted/scrypted-viewport.ts7
1 files changed, 5 insertions, 2 deletions
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;