@apocaliss92/nodelink-js 0.4.34 → 0.4.36

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.
@@ -8274,7 +8274,19 @@ function computeDeviceCapabilities(params) {
8274
8274
  // lightType >= 2 indicates controllable white LED / floodlight (1 = IR only).
8275
8275
  // ledCtrl > 1 is a secondary signal that rescues firmwares like the Duo 3
8276
8276
  // WiFi which under-report lightType (=1) despite having a real spotlight.
8277
- hasFloodlight: Number.isFinite(lightType) ? lightType >= 2 || hasFloodlightFromLedCtrl : hasFloodlightFromAbilities || hasFloodlightFromLedCtrl,
8277
+ //
8278
+ // Doorbell exception: the Reolink desktop app's native SDK exposes
8279
+ // three SEPARATE ability flags — `supportFloodLight`, `supportDoorbellLight`
8280
+ // (with KeepOff/KeepOn sub-flags) and `supportIndicatorLight`. Doorbell-class
8281
+ // devices route the ring / button-area LED through `supportDoorbellLight`,
8282
+ // which is NOT a controllable white-light floodlight. We don't have a
8283
+ // documented bit-level mapping for ledCtrl, so we use the narrowest
8284
+ // rule that matches Reolink's own taxonomy: when the firmware is
8285
+ // categorical with lightType=0 AND the device identifies itself as a
8286
+ // doorbell (doorbellVersion > 0), trust lightType=0 and ignore the
8287
+ // ledCtrl bitmask. Verified against UID 9527000ICL1T1MDS (lightType=0,
8288
+ // ledCtrl=3073, doorbellVersion=31, no spotlight hardware).
8289
+ hasFloodlight: Number.isFinite(lightType) ? lightType >= 2 || hasFloodlightFromLedCtrl && !(isDoorbellFromSupport && lightType === 0) : hasFloodlightFromAbilities || hasFloodlightFromLedCtrl,
8278
8290
  hasPir: hasPirFromAbilities || hasPirFromSupport,
8279
8291
  isDoorbell,
8280
8292
  hasAutotracking: ptzDisabledBySupport ? false : hasAutotrackingFromSupport || hasAutotrackingFromAbilities,
@@ -19181,8 +19193,18 @@ ${xml}`
19181
19193
  * This is more reliable than autoPt in SupportInfo which can be a false positive
19182
19194
  * (e.g., NVR channels report autoPt=1 but don't actually support autotracking).
19183
19195
  *
19196
+ * Doorbell exception (mirrors the {@link computeDeviceCapabilities} floodlight
19197
+ * rule): video-doorbell firmwares (doorbellVersion > 0) ship AiCfg with
19198
+ * `smartTrackMode=1` (the current mode) yet `smartTrackModeAbility=0` (the
19199
+ * firmware's own "no, this device cannot autotrack" flag). Without a PT
19200
+ * motor a doorbell physically cannot autotrack, so when the caller flags the
19201
+ * device as a doorbell AND the firmware admits `smartTrackModeAbility=0`,
19202
+ * trust the firmware and return false. Verified against UID
19203
+ * 9527000ICL1T1MDS: smartTrackMode=1, smartTrackModeAbility=0,
19204
+ * ptzType=0, ptzMode="none", doorbellVersion=31.
19205
+ *
19184
19206
  * @param channel - Channel number (0-based)
19185
- * @param options - Optional timeout
19207
+ * @param options - Optional timeout and doorbell context hint
19186
19208
  * @returns true if autotracking is supported, false otherwise
19187
19209
  */
19188
19210
  async probeAutotrackingSupport(channel, options) {
@@ -19192,6 +19214,14 @@ ${xml}`
19192
19214
  const xml = await this.sendXml({ cmdId: 299, channel: ch, timeoutMs });
19193
19215
  const smartTrackModeRaw = getXmlText(xml, "smartTrackMode");
19194
19216
  const smartTrackMode = Number(smartTrackModeRaw ?? 0);
19217
+ const smartTrackModeAbilityRaw = getXmlText(
19218
+ xml,
19219
+ "smartTrackModeAbility"
19220
+ );
19221
+ const smartTrackModeAbility = smartTrackModeAbilityRaw === void 0 ? void 0 : Number(smartTrackModeAbilityRaw);
19222
+ if (options?.isDoorbell && Number.isFinite(smartTrackModeAbility) && smartTrackModeAbility === 0) {
19223
+ return false;
19224
+ }
19195
19225
  return smartTrackMode > 0;
19196
19226
  } catch {
19197
19227
  return false;
@@ -19284,7 +19314,8 @@ ${xml}`
19284
19314
  const features = this.parseFeaturesFromSupport(support);
19285
19315
  const objects = await this.getAiDetectTypes(ch, { timeoutMs: 1500 });
19286
19316
  const autotrackingProbed = await this.probeAutotrackingSupport(ch, {
19287
- timeoutMs: 1500
19317
+ timeoutMs: 1500,
19318
+ isDoorbell: capabilities.isDoorbell === true
19288
19319
  });
19289
19320
  capabilities.hasAutotracking = autotrackingProbed;
19290
19321
  let presets;
@@ -24794,4 +24825,4 @@ export {
24794
24825
  isTcpFailureThatShouldFallbackToUdp,
24795
24826
  autoDetectDeviceType
24796
24827
  };
24797
- //# sourceMappingURL=chunk-OJ5RWPGY.js.map
24828
+ //# sourceMappingURL=chunk-6ILAHQF5.js.map