@mega-yfue/eufy-sdk 0.5.0-beta.15 → 0.5.0-beta.16

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.
@@ -16,7 +16,10 @@ export interface DeviceRecord {
16
16
  deviceType?: number;
17
17
  model?: string;
18
18
  category?: string;
19
- /** The app-shown device name (`device_name`); see {@link CloudRecord.name}. */
19
+ /**
20
+ * The app-shown device name: `alias_name` first on a vacuum, `device_name` first otherwise;
21
+ * see {@link CloudRecord.name}.
22
+ */
20
23
  name?: string;
21
24
  /** Parent HomeBase serial when attached (topology signal; see {@link CloudRecord.parentSn}). */
22
25
  parentSn?: string;
package/dist/index.js CHANGED
@@ -11057,6 +11057,8 @@ var MODEL_REGISTRY = {
11057
11057
  T8210: { codec: "camera", caps: ["doorbell", "battery"], name: "Video Doorbell" },
11058
11058
  // Confirmed against a real owned unit (named "Doorbell"): Video Doorbell Dual.
11059
11059
  T8214: { codec: "camera", caps: ["doorbell", "battery"], name: "Video Doorbell Dual" },
11060
+ // Battery Video Doorbell Dual, vendor deviceType 91 (BATTERY_DOORBELL_PLUS), reported by two users.
11061
+ T8213: { codec: "camera", caps: ["doorbell", "battery"], name: "Video Doorbell Dual" },
11060
11062
  // Confirmed against a real owned unit: the mains-powered Wired Doorbell 2K. No `battery` row
11061
11063
  // member on purpose — this model is wired, so the codec baseline plus inference is the whole
11062
11064
  // truth for power. Without this row it classified as a plain camera, so the doorbell capability
@@ -26341,6 +26343,12 @@ function deviceClassOf(codec, realtime) {
26341
26343
  const cls = CLASS_BY_CODEC[codec];
26342
26344
  return cls === "camera" && realtime !== "p2p" ? "other" : cls;
26343
26345
  }
26346
+ function recordName(raw, deviceClass) {
26347
+ if (deviceClass === "vacuum") {
26348
+ return raw.alias_name || raw.device_alias_name || raw.device_name || void 0;
26349
+ }
26350
+ return raw.device_name ?? raw.device_alias_name ?? raw.alias_name;
26351
+ }
26344
26352
  var LIST_REUSE_MS = 5e3;
26345
26353
  var CLOUD_DPS_MODELS = /* @__PURE__ */ new Set(["T2351"]);
26346
26354
  var DeviceRegistry = class {
@@ -26463,9 +26471,10 @@ var DeviceRegistry = class {
26463
26471
  category: raw.category,
26464
26472
  params
26465
26473
  }).codec;
26474
+ const deviceClass = deviceClassOf(codec, c.realtime);
26466
26475
  seen.set(raw.device_sn, {
26467
26476
  sn: raw.device_sn,
26468
- name: raw.device_name ?? raw.device_alias_name ?? raw.alias_name,
26477
+ name: recordName(raw, deviceClass),
26469
26478
  model: raw.device_model,
26470
26479
  stationSn: resolvedStationSn(raw, raw.device_sn),
26471
26480
  p2pDid: raw.p2p_did,
@@ -26473,7 +26482,7 @@ var DeviceRegistry = class {
26473
26482
  paramUpdatedAt,
26474
26483
  lastSeenMs: lastSeenMsOf(paramUpdatedAt),
26475
26484
  raw,
26476
- deviceClass: deviceClassOf(codec, c.realtime),
26485
+ deviceClass,
26477
26486
  ...c
26478
26487
  });
26479
26488
  }