@apocaliss92/nodelink-js 0.4.34-beta.0 → 0.4.35

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,
@@ -24126,6 +24138,17 @@ async function discoverReolinkDevices(options = {}) {
24126
24138
  }
24127
24139
 
24128
24140
  // src/reolink/autodetect.ts
24141
+ var ALL_UDP_DISCOVERY_METHODS = [
24142
+ "local-direct",
24143
+ "local-broadcast",
24144
+ "remote",
24145
+ "relay",
24146
+ "map"
24147
+ ];
24148
+ function selectViableUdpMethods(hasUid, methods = ALL_UDP_DISCOVERY_METHODS) {
24149
+ if (hasUid) return [...methods];
24150
+ return methods.filter((m) => m === "local-direct");
24151
+ }
24129
24152
  function normalizeUid(uid) {
24130
24153
  const v = uid?.trim();
24131
24154
  return v ? v : void 0;
@@ -24617,7 +24640,7 @@ async function autoDetectDeviceType(inputs) {
24617
24640
  }
24618
24641
  if (!normalizedUid) {
24619
24642
  logger?.log?.(
24620
- `[AutoDetect] UID discovery failed; will try local-direct without UID first.`
24643
+ `[AutoDetect] UID discovery failed; only local-direct can run without a UID. If the camera is sleeping or on a different subnet, supply its UID to enable BCUDP P2P fallback (remote/relay/map) which can wake it via Reolink's servers.`
24621
24644
  );
24622
24645
  }
24623
24646
  }
@@ -24670,8 +24693,7 @@ async function autoDetectDeviceType(inputs) {
24670
24693
  api: udpApi
24671
24694
  };
24672
24695
  };
24673
- const methodsToTry = ["local-direct", "local-broadcast", "remote", "relay", "map"];
24674
- const viableMethods = normalizedUid ? methodsToTry : methodsToTry.filter((m) => m === "local-direct" || m === "local-broadcast");
24696
+ const viableMethods = selectViableUdpMethods(Boolean(normalizedUid));
24675
24697
  return await runUdpMethodsParallel(
24676
24698
  viableMethods,
24677
24699
  async (m, isAborted) => {
@@ -24777,9 +24799,11 @@ export {
24777
24799
  discoverViaTcpPortScan,
24778
24800
  discoverViaOnvif,
24779
24801
  discoverReolinkDevices,
24802
+ ALL_UDP_DISCOVERY_METHODS,
24803
+ selectViableUdpMethods,
24780
24804
  normalizeUid,
24781
24805
  maskUid,
24782
24806
  isTcpFailureThatShouldFallbackToUdp,
24783
24807
  autoDetectDeviceType
24784
24808
  };
24785
- //# sourceMappingURL=chunk-ZRDPJAXB.js.map
24809
+ //# sourceMappingURL=chunk-N6TCSER3.js.map