@apocaliss92/scrypted-reolink-native 0.3.4 → 0.3.5
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/dist/main.nodejs.js +1 -1
- package/dist/plugin.zip +0 -0
- package/package.json +1 -1
- package/src/camera.ts +0 -5
- package/src/nvr.ts +17 -1
package/dist/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/camera.ts
CHANGED
|
@@ -241,12 +241,7 @@ export class ReolinkCamera extends BaseBaichuanClass implements VideoCamera, Cam
|
|
|
241
241
|
description: 'Order preference for video streams. Default: RTSP -> RTMP -> Native',
|
|
242
242
|
defaultValue: 'Default',
|
|
243
243
|
choices: ['Default', 'Native', 'RTSP', 'RTMP'],
|
|
244
|
-
subgroup: 'Streaming',
|
|
245
244
|
},
|
|
246
|
-
// capabilities: {
|
|
247
|
-
// json: true,
|
|
248
|
-
// hide: true,
|
|
249
|
-
// },
|
|
250
245
|
multifocalInfo: {
|
|
251
246
|
json: true,
|
|
252
247
|
hide: true,
|
package/src/nvr.ts
CHANGED
|
@@ -369,6 +369,22 @@ export class ReolinkNativeNvrDevice extends BaseBaichuanClass implements Setting
|
|
|
369
369
|
isMultifocal,
|
|
370
370
|
identifier,
|
|
371
371
|
});
|
|
372
|
+
|
|
373
|
+
// Check if device already exists in cameraNativeMap with a different nativeId format
|
|
374
|
+
// (e.g., with chN- prefix). If so, use that nativeId for the mapping.
|
|
375
|
+
let actualNativeId = nativeId;
|
|
376
|
+
const existingDevice = Array.from(this.cameraNativeMap.entries()).find(([id, camera]) => {
|
|
377
|
+
// Check if the camera matches by channel or UID
|
|
378
|
+
const cameraChannel = camera.storageSettings.values.rtspChannel;
|
|
379
|
+
const cameraUid = camera.storageSettings.values.uid;
|
|
380
|
+
return cameraChannel === channel || (uid && cameraUid === uid);
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
if (existingDevice) {
|
|
384
|
+
actualNativeId = existingDevice[0];
|
|
385
|
+
logger.debug(`[syncEntities] Using existing nativeId for channel ${channel}: ${actualNativeId} (instead of ${nativeId})`);
|
|
386
|
+
}
|
|
387
|
+
|
|
372
388
|
const interfaces = [ScryptedInterface.VideoCamera];
|
|
373
389
|
if (isBattery) {
|
|
374
390
|
interfaces.push(ScryptedInterface.Battery);
|
|
@@ -388,7 +404,7 @@ export class ReolinkNativeNvrDevice extends BaseBaichuanClass implements Setting
|
|
|
388
404
|
}
|
|
389
405
|
};
|
|
390
406
|
|
|
391
|
-
this.channelToNativeIdMap.set(channel,
|
|
407
|
+
this.channelToNativeIdMap.set(channel, actualNativeId);
|
|
392
408
|
|
|
393
409
|
const allNativeIds = sdk.deviceManager.getNativeIds().filter(nid => !!nid);
|
|
394
410
|
|