@mega-yfue/eufy-sdk 0.4.0-beta.3 → 0.4.0-beta.4

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.
@@ -871,7 +871,10 @@ export declare class EufyMega extends EventEmitter {
871
871
  * one — so this never overwrites a channel a later login already brought up.
872
872
  */
873
873
  private startPush;
874
- /** Admit only exact, account-known devices with resolved snapshot evidence into the passive store. */
874
+ /**
875
+ * Admit only exact, account-known devices with resolved snapshot evidence into the passive store; a
876
+ * station-only candidate is admitted under the event's device serial.
877
+ */
875
878
  private observeStoredImage;
876
879
  /**
877
880
  * Tear down every realtime channel: close the secure-MQTT transport, all P2P sessions, and the FCM
package/dist/index.js CHANGED
@@ -26851,7 +26851,7 @@ var EufyMega = class extends EventEmitter9 {
26851
26851
  if (ev.eventName === void 0 && ev.eventType != null)
26852
26852
  ev.eventName = detectionName(ev.eventType);
26853
26853
  if (ev.thumbnailCandidate)
26854
- void this.observeStoredImage(ev.thumbnailCandidate);
26854
+ void this.observeStoredImage(ev.thumbnailCandidate, ev.deviceSn);
26855
26855
  this.emit("push", ev);
26856
26856
  const signal2 = {
26857
26857
  source: "push",
@@ -26900,9 +26900,16 @@ var EufyMega = class extends EventEmitter9 {
26900
26900
  client.on("error", (e) => this.reportError(e));
26901
26901
  return client;
26902
26902
  }
26903
- /** Admit only exact, account-known devices with resolved snapshot evidence into the passive store. */
26904
- async observeStoredImage(candidate) {
26905
- if (!this.storedImages || candidate.attribution.kind !== "device")
26903
+ /**
26904
+ * Admit only exact, account-known devices with resolved snapshot evidence into the passive store; a
26905
+ * station-only candidate is admitted under the event's device serial.
26906
+ */
26907
+ async observeStoredImage(candidate, eventDeviceSn) {
26908
+ if (!this.storedImages)
26909
+ return;
26910
+ const { attribution } = candidate;
26911
+ const deviceSn = attribution.kind === "device" ? attribution.deviceSn : attribution.kind === "station" ? eventDeviceSn : void 0;
26912
+ if (!deviceSn)
26906
26913
  return;
26907
26914
  const account = this.mega.auth?.userId;
26908
26915
  if (!account)
@@ -26912,9 +26919,9 @@ var EufyMega = class extends EventEmitter9 {
26912
26919
  await this.registry.getDevices();
26913
26920
  if (this.mega.auth?.userId !== account)
26914
26921
  return;
26915
- const caps = this.registry.capabilitiesForDevice(candidate.attribution.deviceSn);
26922
+ const caps = this.registry.capabilitiesForDevice(deviceSn);
26916
26923
  if (caps && hasProvidedAction(caps, "snapshotStored")) {
26917
- this.storedImages.observe(candidate.attribution.deviceSn, candidate.url);
26924
+ this.storedImages.observe(deviceSn, candidate.url);
26918
26925
  }
26919
26926
  } catch (e) {
26920
26927
  this.reportError(e);