@mega-yfue/eufy-sdk 0.5.0-beta.52 → 0.5.0-beta.54
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.
|
@@ -112,8 +112,11 @@ export declare const ARMING_CMD: {
|
|
|
112
112
|
*/
|
|
113
113
|
readonly SET_ALL_ACTION: 1255;
|
|
114
114
|
};
|
|
115
|
-
/**
|
|
116
|
-
|
|
115
|
+
/**
|
|
116
|
+
* The guard modes whose device notification is read and written. Home and away are replayed on a T8010;
|
|
117
|
+
* `custom1` (wire 3) is captured on a T8170, whose own params report it on 1148.
|
|
118
|
+
*/
|
|
119
|
+
export type DeviceNotificationMode = Extract<ArmingMode, "home" | "away" | "custom1">;
|
|
117
120
|
/**
|
|
118
121
|
* Alarm-delay durations the app's OWN picker UI offers — `AlarmDelaySeconds` is both the const
|
|
119
122
|
* value-object (`AlarmDelaySeconds.sec45`) and the union type of its values, so callers pass the
|
|
@@ -237,7 +240,8 @@ export declare const ARMING_MEMBERS: {
|
|
|
237
240
|
/**
|
|
238
241
|
* Whether the device on `channel` sends a push notification in `mode`: its {@link DEVICE_NOTIFY_FLAG}
|
|
239
242
|
* in the action table the station reports for that mode. `undefined` where the station reports no table
|
|
240
|
-
* or the table does not list `channel`. A
|
|
243
|
+
* or the table does not list `channel`. A standalone camera answers from its own 1225/1239/1148 flags,
|
|
244
|
+
* for its own channel only. A device's channel is `EufyDevice.channel`.
|
|
241
245
|
*/
|
|
242
246
|
readonly deviceNotification: import("./members.js").MethodMember<(mode: DeviceNotificationMode, channel: number) => boolean | undefined> & {
|
|
243
247
|
available: (ctx: CommandContext) => boolean;
|
|
@@ -245,9 +249,11 @@ export declare const ARMING_MEMBERS: {
|
|
|
245
249
|
/**
|
|
246
250
|
* Turn the push notification of the device on `channel` on or off in `mode` (cmd
|
|
247
251
|
* {@link ARMING_CMD.SET_ALL_ACTION}): the station's reported table written back with that one flag
|
|
248
|
-
* changed.
|
|
249
|
-
*
|
|
250
|
-
*
|
|
252
|
+
* changed. A standalone camera is sent a one-entry `{mode_id, devices}` table built from its own flags,
|
|
253
|
+
* for its own channel only. Rejects, sending nothing, where the table does not list `channel`. A write
|
|
254
|
+
* builds on the last one sent for that mode until the device reports a table (`${mode}Action` on a
|
|
255
|
+
* standalone camera) observed 15 s after it, so a second write does not revert it; a write whose dispatch
|
|
256
|
+
* rejects is not built on.
|
|
251
257
|
*/
|
|
252
258
|
readonly setDeviceNotification: import("./members.js").MethodMember<(mode: DeviceNotificationMode, channel: number, on: boolean) => Promise<void>> & {
|
|
253
259
|
available: (ctx: CommandContext) => boolean;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Inbound Tuya DP
|
|
2
|
+
* Inbound Tuya DP parsing and routing for eufy Home/Clean (`eufy_home_tuya`) devices.
|
|
3
3
|
*
|
|
4
|
-
* {@link
|
|
5
|
-
* raw DP map. {@link parseTuyaDpEvent} then validates and normalises it to a numeric-keyed record.
|
|
4
|
+
* {@link parseTuyaDpEvent} validates a Tuya cloud DP map and normalises it to a numeric-keyed record.
|
|
6
5
|
* {@link TuyaDpRouter} delivers the result to the registered {@link TuyaDpInbound} listener so the
|
|
7
6
|
* capability layer can consume Tuya state through the same typed getters as AIoT.
|
|
8
|
-
*
|
|
9
|
-
* Inbound messages arrive on `cmd/eufy_home/{model}/{sn}/res` with `sign_code: 0` (no additional
|
|
10
|
-
* encryption — confirmed from clean-device captures). If a future capture shows `sign_code ≠ 0` the
|
|
11
|
-
* payload will be AES-128-ECB encrypted with the device's localKey before the JSON can be parsed.
|
|
12
7
|
*/
|
|
13
8
|
import type { TuyaDpInbound } from "../../core/contracts.js";
|
|
14
9
|
/**
|
|
@@ -21,22 +16,6 @@ import type { TuyaDpInbound } from "../../core/contracts.js";
|
|
|
21
16
|
* valid DP entry was found.
|
|
22
17
|
*/
|
|
23
18
|
export declare function parseTuyaDpEvent(payload: unknown): Record<number, boolean | number | string> | null;
|
|
24
|
-
/**
|
|
25
|
-
* Extract a raw DP map from an inbound Anker MQTT message for a `eufy_home_tuya` device.
|
|
26
|
-
*
|
|
27
|
-
* Messages arrive in the same `{head, payload}` envelope the AIoT path uses, where `payload` is a
|
|
28
|
-
* JSON **string**:
|
|
29
|
-
* ```json
|
|
30
|
-
* { "head": { "cmd": 65537, "cmd_status": 2, "sign_code": 0, ... },
|
|
31
|
-
* "payload": "{\"t\":\"…\",\"protocol\":2,\"data\":{\"104\":80,\"106\":0}}" }
|
|
32
|
-
* ```
|
|
33
|
-
* Two DP layouts inside the decoded payload are handled: Tuya-native (`data.dps`) and AIoT-direct
|
|
34
|
-
* (`data` with integer-keyed DP ids). Falls back to flat `envelope.dps` / `envelope.data.dps`
|
|
35
|
-
* shapes for any pre-parsed delivery. Returns `undefined` when no recognised shape is found.
|
|
36
|
-
*
|
|
37
|
-
* @internal
|
|
38
|
-
*/
|
|
39
|
-
export declare function parseTuyaDpReport(raw: unknown): Record<string, unknown> | undefined;
|
|
40
19
|
/**
|
|
41
20
|
* Routes validated inbound Tuya DP events to the registered {@link TuyaDpInbound} listener.
|
|
42
21
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mega-yfue/eufy-sdk",
|
|
3
|
-
"version": "0.5.0-beta.
|
|
3
|
+
"version": "0.5.0-beta.54",
|
|
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",
|