@mega-yfue/eufy-sdk 0.5.0-beta.42 → 0.5.0-beta.43
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 +2 -0
- package/dist/index.js +15 -1
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
|
@@ -297,6 +297,8 @@ export declare class EufyMega extends EventEmitter {
|
|
|
297
297
|
* manager's own log, since by then nothing is waiting to receive it.
|
|
298
298
|
*/
|
|
299
299
|
private recycleStandaloneSession;
|
|
300
|
+
/** Reopen a wired station that {@link recycleStandaloneSession} closed, while the generation that warmed it is current. */
|
|
301
|
+
private reopenWiredStation;
|
|
300
302
|
/**
|
|
301
303
|
* Whether the DECODED property now reads what the write asked for.
|
|
302
304
|
*
|
package/dist/index.js
CHANGED
|
@@ -28069,10 +28069,24 @@ var EufyMega = class extends EventEmitter13 {
|
|
|
28069
28069
|
recycleStandaloneSession(sn) {
|
|
28070
28070
|
const releaseWrite = new Promise((resolve) => void setTimeout(resolve, SESSION_RECYCLE_WAIT_MS).unref?.());
|
|
28071
28071
|
return Promise.race([
|
|
28072
|
-
this.p2p.resetStandaloneSession(sn),
|
|
28072
|
+
this.p2p.resetStandaloneSession(sn).finally(() => this.reopenWiredStation(sn)),
|
|
28073
28073
|
releaseWrite.then(() => this.opts.logger?.debug(`[session ${sn}] recycle still waiting on an attached viewer \u2014 releasing the write that asked for it`))
|
|
28074
28074
|
]);
|
|
28075
28075
|
}
|
|
28076
|
+
/** Reopen a wired station that {@link recycleStandaloneSession} closed, while the generation that warmed it is current. */
|
|
28077
|
+
reopenWiredStation(sn) {
|
|
28078
|
+
const generation = this.realtimeGeneration;
|
|
28079
|
+
if (generation?.epoch !== this.realtimeEpoch)
|
|
28080
|
+
return;
|
|
28081
|
+
if (this.p2p.stationKeyOf(sn) !== sn || !this.registry.p2pDevices().some((d) => d.sn === sn))
|
|
28082
|
+
return;
|
|
28083
|
+
if (this.stationPower(sn) !== "wired")
|
|
28084
|
+
return;
|
|
28085
|
+
void this.p2p.ensureStation(sn, generation.abort.signal).catch((error) => {
|
|
28086
|
+
if (!generation.abort.signal.aborted)
|
|
28087
|
+
this.reportError(error);
|
|
28088
|
+
});
|
|
28089
|
+
}
|
|
28076
28090
|
/**
|
|
28077
28091
|
* Whether the DECODED property now reads what the write asked for.
|
|
28078
28092
|
*
|