src.nth.io/

summaryrefslogtreecommitdiff
path: root/scrypted
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-06-21 13:15:22 -0500
committerLuke Hoersten <[email protected]>2026-06-21 13:15:22 -0500
commitd2b75bd3158c5aeb33b15203e112dbf7019a5a09 (patch)
tree99ab6a2f2280d057e23cb48116fe37369371376b /scrypted
parentf428746b7efe9d0fcf021b68c968fa2b9e2ce7d0 (diff)
scrypted: diagnostic — enumerate every BinarySensor device
Diffstat (limited to 'scrypted')
-rw-r--r--scrypted/scrypted-viewport.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/scrypted/scrypted-viewport.ts b/scrypted/scrypted-viewport.ts
index 0143b16..68fe84a 100644
--- a/scrypted/scrypted-viewport.ts
+++ b/scrypted/scrypted-viewport.ts
@@ -733,20 +733,20 @@ class ScryptedViewportProvider extends ScryptedDeviceBase
d.interfaces.includes(ScryptedInterface.BinarySensor);
if (isChild || isSiblingBell) targets.push(d);
}
- // One-shot diagnostic: log every device whose name *looks* related
- // to the camera so we can see what's there if the traversal still
- // misses the button.
- const camNameLower = (cam.name || "").toLowerCase();
- const related: string[] = [];
+ // Diagnostic: list every BinarySensor device in the system so we
+ // can see which one is the doorbell button and what its
+ // provider/relationship to the camera looks like.
+ const camAny2 = cam as any;
+ const bells: string[] = [];
for (const id of ids) {
const d: any = systemManager.getDeviceById(id);
- if (!d || d.id === cam.id) continue;
- const nm = (d.name || "").toLowerCase();
- if (camNameLower && nm.includes(camNameLower.split(" ")[0])) {
- related.push(`${d.name} [id=${d.id} provider=${d.providerId} ifaces=${(d.interfaces || []).join(",")}]`);
+ if (!d) continue;
+ if (Array.isArray(d.interfaces) && d.interfaces.includes(ScryptedInterface.BinarySensor)) {
+ bells.push(`${d.name} [id=${d.id} provider=${d.providerId} type=${d.type}]`);
}
}
- if (related.length) this.console.log(`viewport "${tag}": name-related devices: ${related.join(" | ")}`);
+ this.console.log(`viewport "${tag}": camera id=${cam.id} provider=${camAny2.providerId} type=${camAny2.type}`);
+ this.console.log(`viewport "${tag}": BinarySensor devices in system: ${bells.length ? bells.join(" | ") : "(none)"}`);
const regs: EventListenerRegister[] = [];
const targetNames: string[] = [];