@mega-yfue/eufy-sdk 0.6.0-beta.6 → 0.6.0-beta.8
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.
|
@@ -534,6 +534,8 @@ export declare class EufyMega extends EventEmitter {
|
|
|
534
534
|
* first announces it and the others stay silent. Its timing says only when a caller happened to read; the
|
|
535
535
|
* value is the news. It applies what the device volunteered over realtime on top of the cloud half, which
|
|
536
536
|
* the registry keeps apart, so it can neither revert nor announce a revert of a report already landed.
|
|
537
|
+
* Nothing awaits that refresh, so its failure is reported like the other background paths' — a dead
|
|
538
|
+
* token as `sessionExpired`, anything else as `error` — and the read keeps its last-known value.
|
|
537
539
|
*
|
|
538
540
|
* The `Device` returned is held WEAKLY: it is what the inbound paths announce against, so a caller that
|
|
539
541
|
* wants property changes for a serial keeps its own reference. Dropping it stops the announcements, not
|
package/dist/index.js
CHANGED
|
@@ -20568,14 +20568,20 @@ var SharedLiveSource = class {
|
|
|
20568
20568
|
}
|
|
20569
20569
|
/**
|
|
20570
20570
|
* Handle a consumer leaving. When the last one detaches (1→0), release the station-session user via
|
|
20571
|
-
* {@link SharedLiveSourceOptions.onIdle} (its own longer idle timer then arms) and
|
|
20572
|
-
* linger teardown.
|
|
20571
|
+
* {@link SharedLiveSourceOptions.onIdle} (its own longer idle timer then arms) and, while a stream is
|
|
20572
|
+
* still running, arm its linger teardown.
|
|
20573
|
+
*
|
|
20574
|
+
* A source that ended its own stream ends its consumers before tearing down, and a Readable consumer
|
|
20575
|
+
* detaches only once it has reached EOF — after that teardown. The source is then already `stopped`,
|
|
20576
|
+
* with its session claim released, and stays so: lingering would make the owner hand it out again
|
|
20577
|
+
* instead of building a source that holds a session.
|
|
20573
20578
|
*/
|
|
20574
20579
|
onDetach(consumer) {
|
|
20575
20580
|
this.consumers.delete(consumer);
|
|
20576
20581
|
if (this.consumers.size === 0 && !this.disposed) {
|
|
20577
20582
|
this.opts.onIdle?.();
|
|
20578
|
-
this.
|
|
20583
|
+
if (this.stream)
|
|
20584
|
+
this.arm();
|
|
20579
20585
|
}
|
|
20580
20586
|
}
|
|
20581
20587
|
/** Refcount hit zero — arm the linger teardown. A new attach in the window cancels it. */
|
|
@@ -30221,6 +30227,8 @@ var EufyMega = class extends EventEmitter14 {
|
|
|
30221
30227
|
* first announces it and the others stay silent. Its timing says only when a caller happened to read; the
|
|
30222
30228
|
* value is the news. It applies what the device volunteered over realtime on top of the cloud half, which
|
|
30223
30229
|
* the registry keeps apart, so it can neither revert nor announce a revert of a report already landed.
|
|
30230
|
+
* Nothing awaits that refresh, so its failure is reported like the other background paths' — a dead
|
|
30231
|
+
* token as `sessionExpired`, anything else as `error` — and the read keeps its last-known value.
|
|
30224
30232
|
*
|
|
30225
30233
|
* The `Device` returned is held WEAKLY: it is what the inbound paths announce against, so a caller that
|
|
30226
30234
|
* wants property changes for a serial keeps its own reference. Dropping it stops the announcements, not
|
|
@@ -30247,8 +30255,12 @@ var EufyMega = class extends EventEmitter14 {
|
|
|
30247
30255
|
dev.setFreshnessPolicy({
|
|
30248
30256
|
staleAfterMs: this.opts.cacheTtlMs ?? 15e3,
|
|
30249
30257
|
refresh: async () => {
|
|
30250
|
-
|
|
30251
|
-
|
|
30258
|
+
try {
|
|
30259
|
+
const fresh = await this.registry.record(sn);
|
|
30260
|
+
this.applyAndAnnounce(dev, { ...fresh.params, ...fresh.dpParams });
|
|
30261
|
+
} catch (e) {
|
|
30262
|
+
this.reportError(e);
|
|
30263
|
+
}
|
|
30252
30264
|
}
|
|
30253
30265
|
});
|
|
30254
30266
|
}
|