@mega-yfue/eufy-sdk 0.2.0-beta.12 → 0.2.0-beta.14

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/index.js CHANGED
@@ -10408,6 +10408,11 @@ var MODEL_REGISTRY = {
10408
10408
  T8210: { codec: "camera", caps: ["doorbell", "battery"], name: "Video Doorbell" },
10409
10409
  // Confirmed against a real owned unit (named "Doorbell"): Video Doorbell Dual.
10410
10410
  T8214: { codec: "camera", caps: ["doorbell", "battery"], name: "Video Doorbell Dual" },
10411
+ // Confirmed against a real owned unit: the mains-powered Wired Doorbell 2K. No `battery` row
10412
+ // member on purpose — this model is wired, so the codec baseline plus inference is the whole
10413
+ // truth for power. Without this row it classified as a plain camera, so the doorbell capability
10414
+ // never appeared and consumers got no doorbell event entity or ring trigger.
10415
+ T8200: { codec: "camera", caps: ["doorbell"], name: "Wired Doorbell 2K" },
10411
10416
  // Cameras observed on real owned hardware (inspect-device sweep). Names from the app's own
10412
10417
  // model-family constants (scripts/data/app_model_registry.json); caps mirror what the device
10413
10418
  // reports. T8171 has no family entry in that dump, so it keeps the raw T-code.
@@ -14871,6 +14876,11 @@ var P2PSession = class _P2PSession extends EventEmitter2 {
14871
14876
  if (host && !this.closed)
14872
14877
  this.selfAddress = { host, port: boundPort };
14873
14878
  });
14879
+ this.trace({
14880
+ phase: "lookup-channels",
14881
+ local: !this.cfg.noBroadcast || this.cfg.localAddress !== void 0,
14882
+ cloud: this.cfg.dskKey !== void 0 && (this.cfg.cloudAddresses?.length ?? 0) > 0
14883
+ });
14874
14884
  this.sendLookups();
14875
14885
  this.lookupTimer = setInterval(() => this.sendLookups(), LOOKUP_RETRY_MS);
14876
14886
  this.connectTimer = setTimeout(() => {
@@ -14953,8 +14963,6 @@ var P2PSession = class _P2PSession extends EventEmitter2 {
14953
14963
  for (const addr of this.cfg.cloudAddresses)
14954
14964
  this.send(addr, type, payload);
14955
14965
  this.logger.debug(`[p2p] ${this.cfg.stationSn} sendLookups: cloud -> ${this.cfg.cloudAddresses.map((a) => `${a.host}:${a.port}`).join(", ")} self=${this.selfAddress?.host}:${this.selfAddress?.port}`);
14956
- } else {
14957
- this.logger.debug(`[p2p] ${this.cfg.stationSn} sendLookups: NO cloud lookup sent (dskKey=${!!this.cfg.dskKey} cloudAddresses=${this.cfg.cloudAddresses?.length ?? 0})`);
14958
14966
  }
14959
14967
  }
14960
14968
  /**
@@ -19387,7 +19395,6 @@ var FragmentRecording = class extends EventEmitter6 {
19387
19395
 
19388
19396
  // dist/transport/p2p/command-router.js
19389
19397
  var DIRECT_CMD_SENDS = 5;
19390
- var CONNECT_WAIT_MS = 2e4;
19391
19398
  function abortable(work, signal) {
19392
19399
  if (!signal)
19393
19400
  return work;
@@ -19402,7 +19409,7 @@ function abortable(work, signal) {
19402
19409
  var LEVEL2_GRACE_MS = 25e3;
19403
19410
  var LEVEL2_SETTLE_MS = 8e3;
19404
19411
  var P2P_STATION_WAITS = {
19405
- connect: CONNECT_WAIT_MS,
19412
+ connect: CONNECT_TIMEOUT_MS,
19406
19413
  level2Grace: LEVEL2_GRACE_MS,
19407
19414
  level2Settle: LEVEL2_SETTLE_MS
19408
19415
  };
@@ -20573,12 +20580,20 @@ var P2PCommandRouter = class _P2PCommandRouter {
20573
20580
  this.manager.bumpCommand(parentSn, parentSn);
20574
20581
  const channel = typeof raw.device_channel === "number" ? raw.device_channel : 0;
20575
20582
  const stationAdminId = raw.member?.admin_user_id;
20583
+ const stationModel = this.recordFor(parentSn)?.model;
20576
20584
  const accountId = stationAdminId ?? this.deps.mega.auth?.userId ?? "";
20585
+ this.traceOnStation(session, {
20586
+ phase: "station-resolved",
20587
+ topology: homeBaseAttached ? "attached" : "own",
20588
+ channel,
20589
+ stationAdmin: typeof stationAdminId !== "string" ? "unstated" : stationAdminId === this.deps.mega.auth?.userId ? "self" : "other",
20590
+ ...stationModel ? { stationModel } : {}
20591
+ });
20577
20592
  const t0 = Date.now();
20578
20593
  let waitedMs = 0;
20579
20594
  if (!session.isConnected) {
20580
- this.traceOnStation(session, { phase: "session-connect-wait", waitMs: CONNECT_WAIT_MS });
20581
- while (!session.isConnected && Date.now() - t0 < CONNECT_WAIT_MS) {
20595
+ this.traceOnStation(session, { phase: "session-connect-wait", waitMs: P2P_STATION_WAITS.connect });
20596
+ while (!session.isConnected && Date.now() - t0 < P2P_STATION_WAITS.connect) {
20582
20597
  opts.signal?.throwIfAborted();
20583
20598
  await sleep2(200);
20584
20599
  }
@@ -20588,12 +20603,6 @@ var P2PCommandRouter = class _P2PCommandRouter {
20588
20603
  opts.signal?.throwIfAborted();
20589
20604
  if (!session.isConnected)
20590
20605
  throw new StationUnreachableError(parentSn, waitedMs);
20591
- this.traceOnStation(session, {
20592
- phase: "station-resolved",
20593
- topology: homeBaseAttached ? "attached" : "own",
20594
- channel,
20595
- stationAdmin: typeof stationAdminId !== "string" ? "unstated" : stationAdminId === this.deps.mega.auth?.userId ? "self" : "other"
20596
- });
20597
20606
  if (opts.waitLevel2) {
20598
20607
  if (opts.waitLevel2 === "settle") {
20599
20608
  await abortable(session.awaitLevel2Key(LEVEL2_SETTLE_MS, "session"), opts.signal);
@@ -26611,6 +26620,7 @@ export {
26611
26620
  CLEAN_EXTENTS,
26612
26621
  CLEAN_FINISH_REASONS,
26613
26622
  CLEAN_PARAMS,
26623
+ CONNECT_TIMEOUT_MS,
26614
26624
  CONTACT_MEMBERS,
26615
26625
  CO_MEMBERS,
26616
26626
  CameraDisabledError,