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

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
@@ -5240,6 +5240,8 @@ var AUDIO = {
5240
5240
 
5241
5241
  // dist/model/capabilities/camera.js
5242
5242
  var CAMERA_CMD = {
5243
+ /** Camera-reported Wi-Fi signal (app `CMD_GET_WIFI_RSSI`). */
5244
+ WIFI_RSSI: 1142,
5243
5245
  /** Camera on/off. Read and write polarity depend on the family and topology. */
5244
5246
  CAMERA_ENABLE: 1035,
5245
5247
  /** Wrapped T8410 power switch on HomeBase 3. */
@@ -5519,6 +5521,14 @@ function refuseWhenDisabled(ctx, read) {
5519
5521
  throw new CameraDisabledError(ctx.name ?? ctx.serial);
5520
5522
  }
5521
5523
  var CAMERA_MEMBERS = {
5524
+ /** Reads the latest cached report and exposes no setter. */
5525
+ wifiRssi: {
5526
+ param: CAMERA_CMD.WIFI_RSSI,
5527
+ type: "number",
5528
+ kind: "scalar",
5529
+ provenance: "apk",
5530
+ description: "Camera-reported Wi-Fi signal; physical units and a quality scale are unspecified."
5531
+ },
5522
5532
  /**
5523
5533
  * The default READ is the *disable*-bit convention (1035 "0" ⇒ ON, 2001 direct); the WRITE polarity is
5524
5534
  * family-dependent — see `powerValue` / `isEnableBitPolarity`. Battery/solo cams report the state under
@@ -11057,6 +11067,8 @@ var MODEL_REGISTRY = {
11057
11067
  T8210: { codec: "camera", caps: ["doorbell", "battery"], name: "Video Doorbell" },
11058
11068
  // Confirmed against a real owned unit (named "Doorbell"): Video Doorbell Dual.
11059
11069
  T8214: { codec: "camera", caps: ["doorbell", "battery"], name: "Video Doorbell Dual" },
11070
+ // Battery Video Doorbell Dual, vendor deviceType 91 (BATTERY_DOORBELL_PLUS), reported by two users.
11071
+ T8213: { codec: "camera", caps: ["doorbell", "battery"], name: "Video Doorbell Dual" },
11060
11072
  // Confirmed against a real owned unit: the mains-powered Wired Doorbell 2K. No `battery` row
11061
11073
  // member on purpose — this model is wired, so the codec baseline plus inference is the whole
11062
11074
  // truth for power. Without this row it classified as a plain camera, so the doorbell capability
@@ -26341,6 +26353,12 @@ function deviceClassOf(codec, realtime) {
26341
26353
  const cls = CLASS_BY_CODEC[codec];
26342
26354
  return cls === "camera" && realtime !== "p2p" ? "other" : cls;
26343
26355
  }
26356
+ function recordName(raw, deviceClass) {
26357
+ if (deviceClass === "vacuum") {
26358
+ return raw.alias_name || raw.device_alias_name || raw.device_name || void 0;
26359
+ }
26360
+ return raw.device_name ?? raw.device_alias_name ?? raw.alias_name;
26361
+ }
26344
26362
  var LIST_REUSE_MS = 5e3;
26345
26363
  var CLOUD_DPS_MODELS = /* @__PURE__ */ new Set(["T2351"]);
26346
26364
  var DeviceRegistry = class {
@@ -26463,9 +26481,10 @@ var DeviceRegistry = class {
26463
26481
  category: raw.category,
26464
26482
  params
26465
26483
  }).codec;
26484
+ const deviceClass = deviceClassOf(codec, c.realtime);
26466
26485
  seen.set(raw.device_sn, {
26467
26486
  sn: raw.device_sn,
26468
- name: raw.device_name ?? raw.device_alias_name ?? raw.alias_name,
26487
+ name: recordName(raw, deviceClass),
26469
26488
  model: raw.device_model,
26470
26489
  stationSn: resolvedStationSn(raw, raw.device_sn),
26471
26490
  p2pDid: raw.p2p_did,
@@ -26473,7 +26492,7 @@ var DeviceRegistry = class {
26473
26492
  paramUpdatedAt,
26474
26493
  lastSeenMs: lastSeenMsOf(paramUpdatedAt),
26475
26494
  raw,
26476
- deviceClass: deviceClassOf(codec, c.realtime),
26495
+ deviceClass,
26477
26496
  ...c
26478
26497
  });
26479
26498
  }