@apocaliss92/scrypted-reolink-native 0.1.26 → 0.1.28
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/multiFocal.ts +14 -6
package/dist/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/multiFocal.ts
CHANGED
|
@@ -181,13 +181,15 @@ export class ReolinkNativeMultiFocalDevice extends CommonCameraMixin implements
|
|
|
181
181
|
this.storageSettings.values.multifocalInfo = multifocalInfo;
|
|
182
182
|
this.storageSettings.values.capabilities = capabilities;
|
|
183
183
|
|
|
184
|
-
|
|
184
|
+
// TODO: Remove this after debugging
|
|
185
|
+
logger.log(`Multichannel info: ${JSON.stringify({ multifocalInfo, capabilities, support, abilities, features, objects, presets })}`);
|
|
186
|
+
// logger.debug(`Multichannel info: ${JSON.stringify({ multifocalInfo, capabilities, support, abilities, features, objects, presets })}`);
|
|
185
187
|
|
|
186
188
|
for (const channelInfo of multifocalInfo?.channels ?? []) {
|
|
187
189
|
const { channel, lensType } = channelInfo;
|
|
188
190
|
|
|
189
191
|
const name = `${this.name} - ${lensType}`;
|
|
190
|
-
const nativeId = this.
|
|
192
|
+
const nativeId = `${this.nativeId}-channel${channel}${this.isBattery ? batteryCameraSuffix : cameraSuffix}`;
|
|
191
193
|
|
|
192
194
|
this.channelToNativeIdMap.set(channel, nativeId);
|
|
193
195
|
const { interfaces, capabilities: deviceCapabilities } = this.getInterfaces(channel);
|
|
@@ -209,8 +211,16 @@ export class ReolinkNativeMultiFocalDevice extends CommonCameraMixin implements
|
|
|
209
211
|
|
|
210
212
|
await sdk.deviceManager.onDeviceDiscovered(device);
|
|
211
213
|
|
|
214
|
+
// TODO: Remove this after debugging
|
|
215
|
+
logger.log(`Discovering lens device ${nativeId}: ${JSON.stringify({ interfaces, deviceCapabilities })}`);
|
|
216
|
+
|
|
212
217
|
const camera = await this.getDevice(nativeId);
|
|
213
218
|
|
|
219
|
+
if (!camera) {
|
|
220
|
+
logger.error(`Failed to get device ${nativeId}`);
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
|
|
214
224
|
camera.storageSettings.values.rtspChannel = channel;
|
|
215
225
|
camera.classes = objects;
|
|
216
226
|
camera.presets = presets;
|
|
@@ -222,6 +232,8 @@ export class ReolinkNativeMultiFocalDevice extends CommonCameraMixin implements
|
|
|
222
232
|
camera.storageSettings.values.uid = uid;
|
|
223
233
|
}
|
|
224
234
|
}
|
|
235
|
+
|
|
236
|
+
await super.reportDevices();
|
|
225
237
|
}
|
|
226
238
|
|
|
227
239
|
async getDevice(nativeId: string) {
|
|
@@ -254,10 +266,6 @@ export class ReolinkNativeMultiFocalDevice extends CommonCameraMixin implements
|
|
|
254
266
|
super.releaseDevice(id, nativeId);
|
|
255
267
|
}
|
|
256
268
|
|
|
257
|
-
buildNativeId(channel: number): string {
|
|
258
|
-
return `${this.nativeId}-channel${channel}`;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
269
|
forwardNativeEvent(ev: ReolinkSimpleEvent): void {
|
|
262
270
|
const logger = this.getBaichuanLogger();
|
|
263
271
|
const channel = ev?.channel;
|