@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/plugin.zip CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apocaliss92/scrypted-reolink-native",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "Use any reolink camera with Scrypted, even older/unsupported models without HTTP protocol support",
5
5
  "author": "@apocaliss92",
6
6
  "license": "Apache",
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
- // const channelsInfo = await api.getNvrChannelsInfo();
218
- // const deviceInfo = await api.getInfo();
219
- const { support } = 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)}`);
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
- }
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
- // logger.log(`Channel discovery completed. ${JSON.stringify({ devicesData, channels })}`);
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) {