@mega-yfue/eufy-sdk 0.6.0-beta.44 → 0.6.0-beta.45

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
@@ -3736,6 +3736,9 @@ function holds(claim, installed, ctx) {
3736
3736
  return false;
3737
3737
  if (claim.reads?.some((name) => !installed.has(name)))
3738
3738
  return false;
3739
+ const things = ctx?.things;
3740
+ if (claim.things && things && !claim.things.some((id) => things.properties[id]))
3741
+ return false;
3739
3742
  if (claim.homeBaseAttached !== void 0 && ctx?.homeBaseAttached !== void 0) {
3740
3743
  return ctx.homeBaseAttached === claim.homeBaseAttached;
3741
3744
  }
@@ -4668,8 +4671,6 @@ var MOTION = {
4668
4671
  events: [
4669
4672
  { source: "push", match: DoorbellPushEvent.MOTION_DETECTION, emit: "motion" },
4670
4673
  { source: "push", match: CusPushEvent.MOTION_SENSOR_PIR, emit: "motion" },
4671
- { source: "push", match: IndoorPushEvent.CRYING_DETECTION, emit: "cryingDetected", claim: CAMERA_AI_CLAIM },
4672
- { source: "push", match: IndoorPushEvent.SOUND_DETECTION, emit: "soundDetected", claim: CAMERA_AI_CLAIM },
4673
4674
  { source: "push", match: IndoorPushEvent.PET_DETECTION, emit: "petDetection", claim: CAMERA_AI_CLAIM },
4674
4675
  { source: "push", match: DoorbellPushEvent.VEHICLE_DETECTION, emit: "vehicleDetected", claim: VEHICLE_CLAIM },
4675
4676
  { source: "push", match: HB3PairedDevicePushEvent.DOG_DETECTION, emit: "dogDetected", claim: DOG_CLAIM },
@@ -6532,6 +6533,21 @@ var CAMERA = {
6532
6533
  properties: propertiesOf(CAMERA_MEMBERS),
6533
6534
  /** Every camera-codec device has the power/privacy surface. */
6534
6535
  detection: { codecs: ["camera"] },
6536
+ /** The sound (3105) and crying (3104) pushes, each claimed on the product's thing property for it. */
6537
+ events: [
6538
+ {
6539
+ source: "push",
6540
+ match: IndoorPushEvent.SOUND_DETECTION,
6541
+ emit: "soundDetected",
6542
+ claim: { things: ["sound_detection_status", "sound_detection_type"] }
6543
+ },
6544
+ {
6545
+ source: "push",
6546
+ match: IndoorPushEvent.CRYING_DETECTION,
6547
+ emit: "cryingDetected",
6548
+ claim: { things: ["notification_ai_crying_switch", "sound_detection_type"] }
6549
+ }
6550
+ ],
6535
6551
  /** Only the no-argument power verbs, which carry no value for a member to hold. */
6536
6552
  actions({ ctx, sink }) {
6537
6553
  if (!isCameraCodec(ctx))
@@ -14052,6 +14068,8 @@ var Device = class _Device {
14052
14068
  * answers a caller has to be able to tell apart.
14053
14069
  */
14054
14070
  bound = false;
14071
+ /** The product's thing description resolved for this device, as {@link bindActions} was given it. */
14072
+ things;
14055
14073
  /**
14056
14074
  * Read-through freshness policy (injected by the facade via {@link setFreshnessPolicy}; the model
14057
14075
  * stays transport-free — it only calls the supplied `refresh`). Default: caching OFF
@@ -14149,6 +14167,7 @@ var Device = class _Device {
14149
14167
  ff09Settings,
14150
14168
  rawDp: rawDp2
14151
14169
  });
14170
+ this.things = ctx.things;
14152
14171
  this.bound = true;
14153
14172
  }
14154
14173
  /**
@@ -14364,7 +14383,8 @@ var Device = class _Device {
14364
14383
  model: this.model,
14365
14384
  capabilities: new Set(this.capabilities),
14366
14385
  homeBaseAttached: this.stationSn !== this.sn,
14367
- stationSerial: this.stationSn
14386
+ stationSerial: this.stationSn,
14387
+ things: this.things
14368
14388
  })
14369
14389
  };
14370
14390
  }