@apocaliss92/scrypted-reolink-native 0.1.22 → 0.1.23
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 +64 -64
package/dist/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/multifocal.ts
CHANGED
|
@@ -214,71 +214,71 @@ export class ReolinkNativeMultiFocalDevice extends BaseBaichuanClass implements
|
|
|
214
214
|
const logger = this.getBaichuanLogger();
|
|
215
215
|
|
|
216
216
|
try {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
217
|
+
// const channelsInfo = await api.getNvrChannelsInfo();
|
|
218
|
+
// const deviceInfo = await api.getInfo();
|
|
219
|
+
const { support, abilities, features, capabilities } = await api.getDeviceCapabilities();
|
|
220
|
+
const channelNum = support?.channelNum ?? 1;
|
|
221
|
+
logger.log(`Sync entities from remote for ${channelNum} channels`);
|
|
222
|
+
const channels = Array.from({ length: channelNum }, (_, i) => i + 1);
|
|
223
|
+
|
|
224
|
+
const multifocalInfo = await api.getDualLensChannelInfo();
|
|
225
|
+
|
|
226
|
+
logger.log(`Multichannel info: ${JSON.stringify({ multifocalInfo, abilities, features, capabilities })}`);
|
|
227
|
+
|
|
228
|
+
// if (channelNum === 2) {
|
|
229
|
+
|
|
230
|
+
// }
|
|
231
|
+
|
|
232
|
+
for (const channel of channels) {
|
|
233
|
+
// try {
|
|
234
|
+
// const name = deviceInfo?.name || `Channel ${channel}`;
|
|
235
|
+
// const uid = deviceInfo?.uid;
|
|
236
|
+
// const isBattery = !!(abilities?.battery?.ver ?? 0);
|
|
237
|
+
|
|
238
|
+
// const nativeId = this.buildNativeId(channel, uid, isBattery);
|
|
239
|
+
// const interfaces = [ScryptedInterface.VideoCamera];
|
|
240
|
+
// if (isBattery) {
|
|
241
|
+
// interfaces.push(ScryptedInterface.Battery);
|
|
242
|
+
// }
|
|
243
|
+
// const type = abilities.supportDoorbellLight ? ScryptedDeviceType.Doorbell : ScryptedDeviceType.Camera;
|
|
244
|
+
|
|
245
|
+
// const device: Device = {
|
|
246
|
+
// nativeId,
|
|
247
|
+
// name,
|
|
248
|
+
// providerNativeId: this.nativeId,
|
|
249
|
+
// interfaces,
|
|
250
|
+
// type,
|
|
251
|
+
// info: {
|
|
252
|
+
// manufacturer: 'Reolink',
|
|
253
|
+
// model: channelInfo?.typeInfo,
|
|
254
|
+
// serialNumber: uid,
|
|
255
|
+
// }
|
|
256
|
+
// };
|
|
257
|
+
|
|
258
|
+
// this.channelToNativeIdMap.set(channel, nativeId);
|
|
259
|
+
|
|
260
|
+
// if (sdk.deviceManager.getNativeIds().includes(nativeId)) {
|
|
261
|
+
// continue;
|
|
262
|
+
// }
|
|
263
|
+
|
|
264
|
+
// if (this.discoveredDevices.has(nativeId)) {
|
|
265
|
+
// continue;
|
|
266
|
+
// }
|
|
267
|
+
|
|
268
|
+
// this.discoveredDevices.set(nativeId, {
|
|
269
|
+
// device,
|
|
270
|
+
// description: `${name} (Channel ${channel})`,
|
|
271
|
+
// rtspChannel: channel,
|
|
272
|
+
// deviceData: devicesData[channel],
|
|
273
|
+
// });
|
|
274
|
+
|
|
275
|
+
// logger.debug(`Discovered channel ${channel}: ${name}`);
|
|
276
|
+
// } catch (e: any) {
|
|
277
|
+
// logger.debug(`Error processing channel ${channel}: ${e?.message || String(e)}`);
|
|
278
|
+
// }
|
|
279
|
+
}
|
|
280
280
|
|
|
281
|
-
|
|
281
|
+
// logger.log(`Channel discovery completed. ${JSON.stringify({ devicesData, channels })}`);
|
|
282
282
|
} catch (e) {
|
|
283
283
|
logger.error('Failed to sync entities from remote', e);
|
|
284
284
|
if (e instanceof Error) {
|