@mega-yfue/eufy-sdk 0.5.0-beta.51 → 0.5.0-beta.52

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.
@@ -81,10 +81,11 @@ export declare class TuyaClient {
81
81
  */
82
82
  login(eufyUserId: string, phoneCode?: string): Promise<TuyaLoginResult>;
83
83
  /**
84
- * READ/dump a device's cached data-points (`smartlife.m.device.cache.dp.get`).
85
- * Builds the request without needing a working signer; the signer is only exercised on send.
84
+ * READ a device's current data-points (`smartlife.m.device.dp.get`). The envelope's `result` is a
85
+ * flat `{ "<dpId>": value }` map. Builds the request without needing a working signer; the signer is
86
+ * only exercised on send.
86
87
  */
87
- getDeviceDps<T = unknown>(devId: string, dpCacheType?: number): Promise<TuyaEnvelope<T>>;
88
+ getDeviceDps<T = unknown>(devId: string): Promise<TuyaEnvelope<T>>;
88
89
  /**
89
90
  * CONTROL: publish data-points to a device (`smartlife.m.device.dp.publish`). `dps` is
90
91
  * `{ "<dpId>": <value> }`. `gwId` is the gateway/parent id (equals `devId` for a standalone gw).
@@ -32,9 +32,9 @@ export declare class TuyaCommandRouter {
32
32
  /** Promise that resolves once Tuya login has completed. Reset by {@link bind}. */
33
33
  private loginOnce;
34
34
  /**
35
- * eufy SN → Tuya device ids, populated by the facade via {@link registerDevice}.
36
- * The facade extracts the Tuya id from the `raw` device record fields (`tuya_uuid`,
37
- * `tuya_virtual_id`, `tuya_device_id`, `virtualId`) and registers it once the device list loads.
35
+ * eufy SN → Tuya device ids, populated via {@link registerDevice} once the device list loads.
36
+ * The Tuya id is the record's first non-empty `tuya_uuid` / `tuya_virtual_id` / `tuya_device_id` /
37
+ * `virtualId`, or the device's serial when the record carries none of them.
38
38
  */
39
39
  private readonly snMap;
40
40
  constructor(config?: TuyaCommandRouterConfig);
@@ -48,21 +48,17 @@ export declare class TuyaCommandRouter {
48
48
  */
49
49
  bind(userId: string, regionShard?: string, isoCode?: string): void;
50
50
  /**
51
- * Register a eufy SN → Tuya devId mapping. Called by the facade for each `eufy_home_tuya`
52
- * device after the cloud device list loads. The facade extracts the Tuya id from the device's
53
- * raw record (`tuya_uuid` / `tuya_virtual_id` / `tuya_device_id` / `virtualId` fields).
54
- * `gwId` defaults to `devId` — standalone devices share the two.
51
+ * Register a eufy SN → Tuya devId mapping for an `eufy_home_tuya` device. `devId` is the record's
52
+ * first non-empty `tuya_uuid` / `tuya_virtual_id` / `tuya_device_id` / `virtualId`, or the device's
53
+ * serial when the record carries none of them. `gwId` defaults to `devId` — standalone devices
54
+ * share the two.
55
55
  */
56
56
  registerDevice(sn: string, devId: string, gwId?: string): void;
57
57
  private ensureLoggedIn;
58
58
  /**
59
- * Fetch a device's cached DPs from the Tuya cloud (`smartlife.m.device.cache.dp.get`) and deliver
60
- * the raw DP map to the caller. Used for initial state hydration after MQTT subscribe — gets the
61
- * last-known state without waiting for the first realtime push.
62
- *
63
- * The response shape from `getDeviceDps` is not yet pinned from a live capture. The defensive
64
- * extraction tries both `result.dps` (a nested map) and bare `result` (a flat map), and returns
65
- * `null` when neither yields a non-empty record.
59
+ * Read a device's current DPs from the Tuya cloud (`smartlife.m.device.dp.get`) and answer the DP
60
+ * map: the reply's flat `result`, kept to integer DP keys with scalar values. Answers `null` for an
61
+ * unregistered device, a failed reply, or a reply with no DPs.
66
62
  */
67
63
  fetchDps(sn: string): Promise<Record<string, unknown> | null>;
68
64
  /**
@@ -140,10 +140,10 @@ export declare function sendApiRequest<T = unknown>(params: Record<string, strin
140
140
  */
141
141
  export declare function buildPublishDpsAction(devId: string, gwId: string, dps: Record<string, unknown>): TuyaAction;
142
142
  /**
143
- * READ/dump: fetch a device's cached data-points. Action `smartlife.m.device.cache.dp.get` v2.0.
144
- * TODO(verify): `dpCacheType` default (1) was not pinned from the capture.
143
+ * READ: a device's current data-points. Action `smartlife.m.device.dp.get` v1.0, postData `{ devId }`.
144
+ * The reply `result` is a flat `{ "<dpId>": value }` map.
145
145
  */
146
- export declare function buildGetDeviceDpsAction(devId: string, dpCacheType?: number): TuyaAction;
146
+ export declare function buildGetDeviceDpsAction(devId: string): TuyaAction;
147
147
  /**
148
148
  * LOGIN step 1: fetch a pre-login RSA token for a Tuya uid.
149
149
  * Wire-confirmed from the eufy Security app (`com.oceanwing.battery.cam`):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mega-yfue/eufy-sdk",
3
- "version": "0.5.0-beta.51",
3
+ "version": "0.5.0-beta.52",
4
4
  "description": "One typed TypeScript client for the Anker eufy v6 cloud — capability-driven devices, realtime events over P2P/MQTT/push, and live media",
5
5
  "license": "Apache-2.0",
6
6
  "author": "mega-yfue",