@apocaliss92/scrypted-reolink-native 0.4.48 → 0.4.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/main.nodejs.js +1 -1
- package/dist/plugin.zip +0 -0
- package/package.json +1 -1
- package/src/nvr.ts +20 -12
package/dist/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/nvr.ts
CHANGED
|
@@ -345,7 +345,10 @@ export class ReolinkNativeNvrDevice
|
|
|
345
345
|
async init() {
|
|
346
346
|
await this.ensureBaichuanClient();
|
|
347
347
|
await this.subscribeToEvents();
|
|
348
|
-
await this.discoverDevices(true);
|
|
348
|
+
const discovered = await this.discoverDevices(true);
|
|
349
|
+
if (discovered.length > 0) {
|
|
350
|
+
await this.onDeviceEvent(ScryptedInterface.DeviceDiscovery, discovered);
|
|
351
|
+
}
|
|
349
352
|
|
|
350
353
|
await this.updateDeviceInfo();
|
|
351
354
|
}
|
|
@@ -537,21 +540,26 @@ export class ReolinkNativeNvrDevice
|
|
|
537
540
|
.getNativeIds()
|
|
538
541
|
.filter((nid) => !!nid);
|
|
539
542
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
(
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
543
|
+
const matchingNativeId = allNativeIds.find(
|
|
544
|
+
(nid) =>
|
|
545
|
+
nid.includes(uid) ||
|
|
546
|
+
nid.includes(`channel-${channel}`) ||
|
|
547
|
+
// nid.includes(mac) ||
|
|
548
|
+
// nid.includes(ip) ||
|
|
549
|
+
nid.includes(name) ||
|
|
550
|
+
nid === nativeId,
|
|
551
|
+
);
|
|
552
|
+
if (matchingNativeId) {
|
|
553
|
+
logger.debug(
|
|
554
|
+
`[syncEntities] Skipping channel ${channel} (${name}): already registered as nativeId="${matchingNativeId}" (computed="${nativeId}", uid="${uid}")`,
|
|
555
|
+
);
|
|
551
556
|
continue;
|
|
552
557
|
}
|
|
553
558
|
|
|
554
559
|
if (this.discoveredDevices.has(nativeId)) {
|
|
560
|
+
logger.debug(
|
|
561
|
+
`[syncEntities] Skipping channel ${channel} (${name}): already in discoveredDevices cache (nativeId="${nativeId}")`,
|
|
562
|
+
);
|
|
555
563
|
continue;
|
|
556
564
|
}
|
|
557
565
|
|