@mega-yfue/eufy-sdk 0.5.0-beta.1 → 0.5.0-beta.11

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.
@@ -98,6 +98,8 @@ export declare class EufyMega extends EventEmitter {
98
98
  private readonly prewarmTiers;
99
99
  /** Transport-side owner of the P2P sessions + all wire senders. */
100
100
  private readonly p2p;
101
+ /** Transport-side owner of the T9000 station sessions (sibling of {@link p2p}). */
102
+ private readonly rtc;
101
103
  /** Transport-side owner of the secure-MQTT ff09 lock/garage command path (sibling of {@link p2p}). */
102
104
  private readonly mqtt;
103
105
  /** Transport-side owner of the legacy Tuya REST command path for non-AIoT vacuums (G-series). */
@@ -234,6 +236,11 @@ export declare class EufyMega extends EventEmitter {
234
236
  *
235
237
  * The evidence set is widened, never replaced: the ids come back through the cloud record, and a
236
238
  * record that omits a realtime-only id would otherwise un-know it and re-trigger on the next report.
239
+ *
240
+ * The device is re-resolved against the fresh record before binding. A property gated on a
241
+ * realtime-only param enters the schema only once that param is evidence, and the value that made it
242
+ * evidence was stored before the property existed, so the record's realtime params are applied again
243
+ * to land it under the property's name.
237
244
  */
238
245
  private rebindReads;
239
246
  /** The distinct credential scopes the current MQTT roster needs — no devices on a scope, no connection. */
@@ -261,6 +268,8 @@ export declare class EufyMega extends EventEmitter {
261
268
  * only "differs from what was read before", which state already on hand can satisfy spuriously — and the
262
269
  * caller that has no expectation is the push path, where the signal itself is the news that a re-read is owed.
263
270
  *
271
+ * Only a write's observation throws at the deadline; a push with nothing moved answers `false`.
272
+ *
264
273
  * The cloud half is asked for through {@link DeviceRegistry.refreshedList}, never by fetching the account
265
274
  * list outright. The fetch is account-wide — one house list plus one device list per house — so a param that
266
275
  * never converges would otherwise spend a whole burst of those every iteration of this loop, and concurrent
@@ -409,8 +418,9 @@ export declare class EufyMega extends EventEmitter {
409
418
  * The `eufy_life` DP writes (smart lights) are secure-MQTT-only. `aiot-dp` routes to either the
410
419
  * Anker AIoT MQTT stack or the legacy Tuya REST router depending on the device's category
411
420
  * (`eufy_home_tuya` → Tuya, everything else → MQTT). The capability layer emits a single `aiot-dp`
412
- * kind and stays transport-agnostic; only the facade sees both sides and decides here. Everything
413
- * else is P2P.
421
+ * kind and stays transport-agnostic; only the facade sees both sides and decides here. A T9000
422
+ * station and the devices attached to it go over RTC, with an attached device's command refused
423
+ * unless its channel resolves back to it on the station. Everything else is P2P.
414
424
  */
415
425
  private routeCommand;
416
426
  /**
@@ -835,11 +845,14 @@ export declare class EufyMega extends EventEmitter {
835
845
  */
836
846
  setProperty(sn: string, name: string, value: boolean | number | string): Promise<void>;
837
847
  /**
838
- * Restart a HomeBase.
848
+ * Restart a station: a HomeBase, or a camera-family device that is its own station.
839
849
  *
840
- * **HomeBases only** — restart is a hub operation, so a non-HomeBase serial (a camera, an NVR)
841
- * throws rather than doing nothing. The hub drops its connection and returns after a minute or two,
842
- * so everything behind it is briefly offline. Verified on real hardware.
850
+ * The restart is `RESTART_HUB` on the station's broadcast channel, so it reaches whatever owns the
851
+ * P2P session. A standalone camera or doorbell owns its own session and is the station it restarts.
852
+ * A camera attached to a HomeBase is not — the same frame would restart its HomeBase — so its serial
853
+ * throws, as does any non-camera serial, rather than doing nothing. The device drops its connection
854
+ * and returns after a minute or two; a HomeBase takes everything behind it offline meanwhile.
855
+ * Verified on real hardware against a HomeBase and a standalone indoor camera.
843
856
  */
844
857
  reboot(sn: string): Promise<void>;
845
858
  /**
@@ -857,6 +870,7 @@ export declare class EufyMega extends EventEmitter {
857
870
  * exactly the reads it has.
858
871
  */
859
872
  private fetchDpCatalog;
873
+ /** The {@link CommandContext} for a device, built from `known` when that record is already in hand. */
860
874
  private commandContext;
861
875
  /**
862
876
  * **Generic P2P request/reply query** — sends a `SET_PAYLOAD` sub-command and resolves with the
@@ -390,7 +390,7 @@ export type EufyMegaEventMap = {
390
390
  sn: string;
391
391
  property: string;
392
392
  param: number;
393
- expected?: boolean | number | string;
393
+ expected: boolean | number | string;
394
394
  observed?: boolean | number | string;
395
395
  timeoutMs: number;
396
396
  }
@@ -230,7 +230,7 @@ export interface StateConvergenceFailure {
230
230
  property: string;
231
231
  param: number;
232
232
  /** The RAW param value the write asked the device to report. */
233
- expected?: boolean | number | string;
233
+ expected: boolean | number | string;
234
234
  /** What the param actually read when the deadline passed, absent where the device reported none at all. */
235
235
  observed?: boolean | number | string;
236
236
  timeoutMs: number;
@@ -248,7 +248,7 @@ export declare class StateConvergenceError extends Error {
248
248
  readonly sn: string;
249
249
  readonly property: string;
250
250
  readonly param: number;
251
- readonly expected?: boolean | number | string;
251
+ readonly expected: boolean | number | string;
252
252
  readonly observed?: boolean | number | string;
253
253
  readonly timeoutMs: number;
254
254
  constructor(failure: StateConvergenceFailure);
@@ -16,6 +16,8 @@ export interface PersistedSession {
16
16
  authToken: string;
17
17
  geoKey?: string;
18
18
  region: RegionShard;
19
+ /** The host `estimate_domain` answered; it names shards the region classification cannot (`ie`). */
20
+ estimatedDomain?: string;
19
21
  openudid: string;
20
22
  /** This install's reported device model + media user-agent, generated once and reused. */
21
23
  phoneModel?: string;