@apocaliss92/scrypted-reolink-native 0.1.24 → 0.1.25
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-battery.ts +1 -2
- package/src/common.ts +39 -31
- package/src/multiFocal.ts +1 -1
package/dist/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/camera-battery.ts
CHANGED
|
@@ -120,8 +120,7 @@ export class ReolinkNativeBatteryCamera extends CommonCameraMixin {
|
|
|
120
120
|
|
|
121
121
|
logger.log('Starting periodic tasks for battery camera');
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
if (!this.nvrDevice) {
|
|
123
|
+
if (!this.nvrDevice && !this.multiFocalDevice) {
|
|
125
124
|
this.sleepCheckTimer = setInterval(async () => {
|
|
126
125
|
try {
|
|
127
126
|
const api = this.baichuanApi;
|
package/src/common.ts
CHANGED
|
@@ -527,8 +527,8 @@ export abstract class CommonCameraMixin extends BaseBaichuanClass implements Vid
|
|
|
527
527
|
thisDevice: Settings
|
|
528
528
|
|
|
529
529
|
constructor(
|
|
530
|
-
nativeId: string,
|
|
531
|
-
public plugin: ReolinkNativePlugin,
|
|
530
|
+
nativeId: string,
|
|
531
|
+
public plugin: ReolinkNativePlugin,
|
|
532
532
|
public options: CommonCameraMixinOptions
|
|
533
533
|
) {
|
|
534
534
|
super(nativeId);
|
|
@@ -654,7 +654,7 @@ export abstract class CommonCameraMixin extends BaseBaichuanClass implements Vid
|
|
|
654
654
|
}
|
|
655
655
|
|
|
656
656
|
public getAbilities(): DeviceCapabilities {
|
|
657
|
-
if(this.options.multiFocalDevice) {
|
|
657
|
+
if (this.options.multiFocalDevice) {
|
|
658
658
|
return this.options.multiFocalDevice.getInterfaces(this.storageSettings.values.rtspChannel).capabilities;
|
|
659
659
|
} else {
|
|
660
660
|
return this.storageSettings.values.capabilities;
|
|
@@ -1116,6 +1116,11 @@ export abstract class CommonCameraMixin extends BaseBaichuanClass implements Vid
|
|
|
1116
1116
|
async updateDeviceInfo(): Promise<void> {
|
|
1117
1117
|
const logger = this.getBaichuanLogger();
|
|
1118
1118
|
|
|
1119
|
+
if (this.options.multiFocalDevice) {
|
|
1120
|
+
this.info = this.options.multiFocalDevice.info;
|
|
1121
|
+
return;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1119
1124
|
const { ipAddress, rtspChannel } = this.storageSettings.values;
|
|
1120
1125
|
try {
|
|
1121
1126
|
const api = await this.ensureClient();
|
|
@@ -1446,38 +1451,41 @@ export abstract class CommonCameraMixin extends BaseBaichuanClass implements Vid
|
|
|
1446
1451
|
const channel = this.storageSettings.values.rtspChannel;
|
|
1447
1452
|
|
|
1448
1453
|
try {
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
this.storageSettings.values.capabilities = capabilities;
|
|
1456
|
-
this.ptzPresets.setCachedPtzPresets(presets);
|
|
1457
|
-
|
|
1458
|
-
try {
|
|
1459
|
-
const { interfaces, type } = getDeviceInterfaces({
|
|
1460
|
-
capabilities,
|
|
1461
|
-
logger: this.console,
|
|
1454
|
+
if (this.options.multiFocalDevice) {
|
|
1455
|
+
// do nothing for now
|
|
1456
|
+
} else {
|
|
1457
|
+
const { capabilities, abilities, support, presets, objects } = await this.withBaichuanRetry(async () => {
|
|
1458
|
+
const api = await this.ensureClient();
|
|
1459
|
+
return await api.getDeviceCapabilities(channel);
|
|
1462
1460
|
});
|
|
1461
|
+
this.classes = objects;
|
|
1462
|
+
this.presets = presets;
|
|
1463
|
+
this.ptzPresets.setCachedPtzPresets(presets);
|
|
1463
1464
|
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1465
|
+
try {
|
|
1466
|
+
const { interfaces, type } = getDeviceInterfaces({
|
|
1467
|
+
capabilities,
|
|
1468
|
+
logger: this.console,
|
|
1469
|
+
});
|
|
1470
|
+
|
|
1471
|
+
const device: Device = {
|
|
1472
|
+
nativeId: this.nativeId,
|
|
1473
|
+
providerNativeId: this.nvrDevice?.nativeId ?? this.plugin?.nativeId,
|
|
1474
|
+
name: this.name,
|
|
1475
|
+
interfaces,
|
|
1476
|
+
type,
|
|
1477
|
+
info: this.info,
|
|
1478
|
+
};
|
|
1479
|
+
|
|
1480
|
+
logger.log(`Updating device interfaces: ${JSON.stringify(device)}`);
|
|
1481
|
+
|
|
1482
|
+
await sdk.deviceManager.onDeviceDiscovered(device);
|
|
1483
|
+
} catch (e) {
|
|
1484
|
+
logger.error('Failed to update device interfaces', e);
|
|
1485
|
+
}
|
|
1474
1486
|
|
|
1475
|
-
|
|
1476
|
-
} catch (e) {
|
|
1477
|
-
logger.error('Failed to update device interfaces', e);
|
|
1487
|
+
logger.log(`Refreshed device capabilities: ${JSON.stringify({ capabilities, abilities, support, presets })}`);
|
|
1478
1488
|
}
|
|
1479
|
-
|
|
1480
|
-
logger.log(`Refreshed device capabilities: ${JSON.stringify({ capabilities, abilities, support, presets })}`);
|
|
1481
1489
|
}
|
|
1482
1490
|
catch (e) {
|
|
1483
1491
|
logger.error('Failed to refresh abilities', e);
|
package/src/multiFocal.ts
CHANGED
|
@@ -232,7 +232,7 @@ export class ReolinkNativeMultiFocalDevice extends BaseBaichuanClass implements
|
|
|
232
232
|
async reportDevices(): Promise<void> {
|
|
233
233
|
const api = await this.ensureBaichuanClient();
|
|
234
234
|
const logger = this.getBaichuanLogger();
|
|
235
|
-
const {
|
|
235
|
+
const { username, password, ipAddress, uid } = this.storageSettings.values;
|
|
236
236
|
|
|
237
237
|
const { capabilities, support, abilities, features, objects, presets } = await api.getDeviceCapabilities();
|
|
238
238
|
|