@mega-yfue/eufy-sdk 0.6.0-beta.28 → 0.6.0-beta.29
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/client/eufy-mega.d.ts +9 -6
- package/dist/index.js +13 -8
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
|
@@ -335,7 +335,8 @@ export declare class EufyMega extends EventEmitter {
|
|
|
335
335
|
* receives nothing until a command dials it again. The first reopen runs at once; one that fails is
|
|
336
336
|
* retried after {@link STATION_REOPEN_MIN_MS}, doubling up to {@link STATION_REOPEN_MAX_MS}, until the
|
|
337
337
|
* session connects or the generation ends. One reopen is pending per station at a time, and each failure
|
|
338
|
-
* is reported once, by {@link P2PCommandRouter.ensureStation}.
|
|
338
|
+
* is reported once, by {@link P2PCommandRouter.ensureStation}. A HomeBase S1 Pro (T9000) answers no P2P
|
|
339
|
+
* lookup, so it is never reopened.
|
|
339
340
|
*/
|
|
340
341
|
private reopenWiredStation;
|
|
341
342
|
/**
|
|
@@ -779,8 +780,9 @@ export declare class EufyMega extends EventEmitter {
|
|
|
779
780
|
*/
|
|
780
781
|
keepStationWarm(stationSn: string): () => void;
|
|
781
782
|
/** Eagerly open P2P sessions for WIRED stations only (persistent — they don't drain). Battery
|
|
782
|
-
* stations stay closed until an on-demand open
|
|
783
|
-
*
|
|
783
|
+
* stations stay closed until an on-demand open, and a HomeBase S1 Pro (T9000), which answers no P2P
|
|
784
|
+
* lookup and is driven over RTC, is never opened here. Best-effort per station: one that fails is
|
|
785
|
+
* handed to {@link reopenWiredStation}. */
|
|
784
786
|
private warmWiredP2P;
|
|
785
787
|
/**
|
|
786
788
|
* A station's power tier for the P2P lifecycle: a HomeBase/station is `"wired"` (persistent); a
|
|
@@ -796,10 +798,11 @@ export declare class EufyMega extends EventEmitter {
|
|
|
796
798
|
* semantic event in — so a stream or talkback opened right after a doorbell ring or a detection starts
|
|
797
799
|
* warm instead of paying a cold open.
|
|
798
800
|
*
|
|
799
|
-
*
|
|
801
|
+
* Five gates. `autoRealtime: false` means the SDK opens nothing on its own initiative at all;
|
|
800
802
|
* {@link EufyMegaOptions.prewarmEvents} must name the event, and it names none by default, which is
|
|
801
|
-
* what makes pre-warm opt-in; the station must be one the account actually reports;
|
|
802
|
-
*
|
|
803
|
+
* what makes pre-warm opt-in; the station must be one the account actually reports; it must not be a
|
|
804
|
+
* HomeBase S1 Pro (T9000), which answers no P2P lookup and is driven over RTC; and its power tier must
|
|
805
|
+
* be one {@link EufyMegaOptions.prewarmTiers} allows.
|
|
803
806
|
*
|
|
804
807
|
* The tier is resolved for the STATION whose session would open, which is why an attached camera is
|
|
805
808
|
* judged by its base — {@link P2PCommandRouter.stationKeyOf} is the single source of that mapping, and
|
package/dist/index.js
CHANGED
|
@@ -30209,7 +30209,8 @@ var EufyMega = class _EufyMega extends EventEmitter14 {
|
|
|
30209
30209
|
* receives nothing until a command dials it again. The first reopen runs at once; one that fails is
|
|
30210
30210
|
* retried after {@link STATION_REOPEN_MIN_MS}, doubling up to {@link STATION_REOPEN_MAX_MS}, until the
|
|
30211
30211
|
* session connects or the generation ends. One reopen is pending per station at a time, and each failure
|
|
30212
|
-
* is reported once, by {@link P2PCommandRouter.ensureStation}.
|
|
30212
|
+
* is reported once, by {@link P2PCommandRouter.ensureStation}. A HomeBase S1 Pro (T9000) answers no P2P
|
|
30213
|
+
* lookup, so it is never reopened.
|
|
30213
30214
|
*/
|
|
30214
30215
|
reopenWiredStation(sn) {
|
|
30215
30216
|
const generation = this.realtimeGeneration;
|
|
@@ -30217,7 +30218,7 @@ var EufyMega = class _EufyMega extends EventEmitter14 {
|
|
|
30217
30218
|
return;
|
|
30218
30219
|
if (this.p2p.stationKeyOf(sn) !== sn || !this.registry.p2pDevices().some((d) => d.sn === sn))
|
|
30219
30220
|
return;
|
|
30220
|
-
if (this.stationPower(sn) !== "wired")
|
|
30221
|
+
if (this.stationPower(sn) !== "wired" || this.stationOf(sn).t9000)
|
|
30221
30222
|
return;
|
|
30222
30223
|
const reopen = this.stationReopens.get(sn) ?? { timer: new Timer(), delayMs: 0 };
|
|
30223
30224
|
this.stationReopens.set(sn, reopen);
|
|
@@ -31177,13 +31178,14 @@ var EufyMega = class _EufyMega extends EventEmitter14 {
|
|
|
31177
31178
|
return this.rtc.keepWarm(route);
|
|
31178
31179
|
}
|
|
31179
31180
|
/** Eagerly open P2P sessions for WIRED stations only (persistent — they don't drain). Battery
|
|
31180
|
-
* stations stay closed until an on-demand open
|
|
31181
|
-
*
|
|
31181
|
+
* stations stay closed until an on-demand open, and a HomeBase S1 Pro (T9000), which answers no P2P
|
|
31182
|
+
* lookup and is driven over RTC, is never opened here. Best-effort per station: one that fails is
|
|
31183
|
+
* handed to {@link reopenWiredStation}. */
|
|
31182
31184
|
async warmWiredP2P(readiness = createPlaneReadiness(), signal) {
|
|
31183
31185
|
const wired = /* @__PURE__ */ new Set();
|
|
31184
31186
|
for (const d of this.registry.p2pDevices()) {
|
|
31185
31187
|
const key = this.p2p.stationKeyOf(d.sn);
|
|
31186
|
-
if (this.stationPower(key) === "wired")
|
|
31188
|
+
if (this.stationPower(key) === "wired" && !this.stationOf(key).t9000)
|
|
31187
31189
|
wired.add(key);
|
|
31188
31190
|
}
|
|
31189
31191
|
readiness.required = wired.size;
|
|
@@ -31228,10 +31230,11 @@ var EufyMega = class _EufyMega extends EventEmitter14 {
|
|
|
31228
31230
|
* semantic event in — so a stream or talkback opened right after a doorbell ring or a detection starts
|
|
31229
31231
|
* warm instead of paying a cold open.
|
|
31230
31232
|
*
|
|
31231
|
-
*
|
|
31233
|
+
* Five gates. `autoRealtime: false` means the SDK opens nothing on its own initiative at all;
|
|
31232
31234
|
* {@link EufyMegaOptions.prewarmEvents} must name the event, and it names none by default, which is
|
|
31233
|
-
* what makes pre-warm opt-in; the station must be one the account actually reports;
|
|
31234
|
-
*
|
|
31235
|
+
* what makes pre-warm opt-in; the station must be one the account actually reports; it must not be a
|
|
31236
|
+
* HomeBase S1 Pro (T9000), which answers no P2P lookup and is driven over RTC; and its power tier must
|
|
31237
|
+
* be one {@link EufyMegaOptions.prewarmTiers} allows.
|
|
31235
31238
|
*
|
|
31236
31239
|
* The tier is resolved for the STATION whose session would open, which is why an attached camera is
|
|
31237
31240
|
* judged by its base — {@link P2PCommandRouter.stationKeyOf} is the single source of that mapping, and
|
|
@@ -31251,6 +31254,8 @@ var EufyMega = class _EufyMega extends EventEmitter14 {
|
|
|
31251
31254
|
const station = this.p2p.stationKeyOf(deviceSn);
|
|
31252
31255
|
if (!this.registry.list().some((device) => device.sn === station))
|
|
31253
31256
|
return;
|
|
31257
|
+
if (this.stationOf(station).t9000)
|
|
31258
|
+
return;
|
|
31254
31259
|
if (!this.prewarmTiers.has(this.stationPower(station)))
|
|
31255
31260
|
return;
|
|
31256
31261
|
void this.p2p.prewarm(station, this.opts.prewarmMs);
|