@mega-yfue/eufy-sdk 0.2.0-beta.19 → 0.2.0-beta.20
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/index.js +33 -16
- package/dist/index.js.map +2 -2
- package/dist/model/capabilities/access.d.ts +22 -3
- package/dist/model/capabilities/arming.d.ts +4 -0
- package/dist/model/capabilities/contact.d.ts +4 -0
- package/dist/model/capabilities/ptz.d.ts +6 -2
- package/dist/transport/p2p/command-router.d.ts +7 -0
- package/package.json +1 -1
|
@@ -50,9 +50,28 @@ export declare function setJsonRaw(cmd: number, data: Record<string, unknown>, c
|
|
|
50
50
|
* Set a param carried in the `SET_PAYLOAD` (1350) envelope — `{account_id,cmd,mChannel,mValue3:cmd,
|
|
51
51
|
* payload}`, GCM signCode 8 — NOT the bare `{commandType,data}` 1700 wrapper `setJson` uses. The wire
|
|
52
52
|
* eufy uses for a few doorbell controls (status-LED 1716 `{light_enable}`). Level-2 by default; the
|
|
53
|
-
* sink resolves the session/account_id and replays the frame.
|
|
54
|
-
*
|
|
55
|
-
*
|
|
53
|
+
* sink resolves the session/account_id and replays the frame.
|
|
54
|
+
*
|
|
55
|
+
* ## When this envelope takes `form: "auto"`
|
|
56
|
+
*
|
|
57
|
+
* Left at the default the frame is level-2 ONLY, and on a station holding no level-2 key that does not
|
|
58
|
+
* fail — it WAITS: the transport spends the full level-2 grace, re-prompts, spends it again, and only
|
|
59
|
+
* then throws. Every caller with a shorter bound sees a hang rather than a refusal, so a control on a
|
|
60
|
+
* device that may be its own keyless station is effectively unreachable. `"auto"` hands the choice to
|
|
61
|
+
* the session (`sendBySessionLevel`), which seals level-2 wherever a key exists — unchanged for a
|
|
62
|
+
* HomeBase — and level-1 where none does.
|
|
63
|
+
*
|
|
64
|
+
* Two conditions, and BOTH have to hold:
|
|
65
|
+
*
|
|
66
|
+
* 1. **`mValue3` is passed explicitly as 0.** The level-1 form of this envelope writes `mValue3:0`
|
|
67
|
+
* itself, while the level-2 form defaults it to the sub-command — so a command that passes 0 sends
|
|
68
|
+
* byte-identical JSON either way and `"auto"` only changes the seal. A command that OMITS `mValue3`
|
|
69
|
+
* would send a DIFFERENT object at level 1 than the one captured at level 2; that is a new wire
|
|
70
|
+
* needing its own evidence, not a downgrade, and it stays pinned until something captures it.
|
|
71
|
+
* 2. **The device can be its own station.** A camera or doorbell may be standalone; a HomeBase, and an
|
|
72
|
+
* accessory whose session IS its HomeBase's, always holds a key. Where a key is structurally
|
|
73
|
+
* guaranteed, staying pinned is the honest behaviour: a keyless station there is an anomaly, and
|
|
74
|
+
* throwing says so where a silently-ignored level-1 frame would look like success.
|
|
56
75
|
*/
|
|
57
76
|
export declare function setPayload(cmd: number, payload: Record<string, unknown>, ctx: CommandContext, mValue3?: number, channel?: number, form?: ScalarForm): Command;
|
|
58
77
|
/**
|
|
@@ -72,6 +72,10 @@ export declare const ARMING_CMD: {
|
|
|
72
72
|
* first, then `schedule` 2, `custom2` 4, `custom3` 5, `off` 6 and `geo` 47 — each sent as this exact
|
|
73
73
|
* frame and each observed to bring MODE_SWITCH back, so all nine are settable. `ARMING_MODE_WIRE` has
|
|
74
74
|
* the per-value evidence and the dates.
|
|
75
|
+
*
|
|
76
|
+
* The ENCRYPTION LEVEL is the session's to pick (`"auto"`), not this command's: the T8030 the envelope
|
|
77
|
+
* was captured on holds a level-2 key and seals it level-2, while an own-session camera that never
|
|
78
|
+
* negotiates one carries the same envelope level-1. See `armingCommand`.
|
|
75
79
|
*/
|
|
76
80
|
readonly SET_ARMING: 1224;
|
|
77
81
|
/**
|
|
@@ -106,6 +106,10 @@ export declare const CONTACT_MEMBERS: {
|
|
|
106
106
|
* `1350` SET_PAYLOAD, `mChannel` = the device channel, `mValue3` 0, payload carrying the channel and a
|
|
107
107
|
* transaction stamp — the byte-shape of the app's own captured frame. Out of range is refused rather
|
|
108
108
|
* than clamped: the app's slider has no values outside it, so one is a caller error, not a nudge.
|
|
109
|
+
*
|
|
110
|
+
* Level-2 only, though the `mValue3` 0 would allow `"auto"`: an entry sensor's session IS its
|
|
111
|
+
* HomeBase's, which always holds a key — the second of `setPayload`'s two conditions, not an oversight
|
|
112
|
+
* of the first.
|
|
109
113
|
*/
|
|
110
114
|
readonly alarmVolume: {
|
|
111
115
|
readonly param: 1508;
|
|
@@ -199,8 +199,12 @@ export declare function savePresetCommand(id: number, ctx: CommandContext): [Com
|
|
|
199
199
|
*
|
|
200
200
|
* 6242 sets the default to the preset the camera is **currently parked on**. To move the default, park
|
|
201
201
|
* the camera on `presetId` first — `preview(presetId)`, let the pan finish, then `setDefault(presetId)`.
|
|
202
|
-
* Sent while the camera is elsewhere, it has no effect.
|
|
203
|
-
*
|
|
202
|
+
* Sent while the camera is elsewhere, it has no effect.
|
|
203
|
+
*
|
|
204
|
+
* Level-2 only, unlike `zoom` beside it: this frame carries the envelope's DEFAULT `mValue3` (the
|
|
205
|
+
* sub-command), which the level-1 form cannot express — it writes 0. Downgrading it would send an
|
|
206
|
+
* object nothing has captured, so it stays pinned and is unreachable on a keyless standalone camera
|
|
207
|
+
* until one is. See `setPayload`'s two conditions.
|
|
204
208
|
*/
|
|
205
209
|
export declare function setDefaultPositionCommand(presetId: number, ctx: CommandContext): Command;
|
|
206
210
|
/**
|
|
@@ -675,6 +675,13 @@ export declare class P2PCommandRouter {
|
|
|
675
675
|
* standalone camera never negotiates a level-2 key, so pinning this to level 2 makes the envelope
|
|
676
676
|
* unreachable on exactly the devices that serve their own RTSP stream. Verified live: a standalone
|
|
677
677
|
* camera accepts the level-1 form. With no `form` (default) it stays level-2 only.
|
|
678
|
+
*
|
|
679
|
+
* Both seals REPLAY the frame {@link DIRECT_CMD_SENDS}× at 200ms, as every other fire-and-forget
|
|
680
|
+
* control on this router does: these are unacknowledged datagrams, and a level-1 device is the one
|
|
681
|
+
* least able to afford a single dropped one — it has no reply, no readback here, and nothing that
|
|
682
|
+
* would tell a caller the write was lost rather than refused. The level-1 form reports delivery by
|
|
683
|
+
* throwing (`sendSetPayload` throws when the session has no address) rather than by returning a
|
|
684
|
+
* boolean, so the first pass carries the failure and the rest are repeats.
|
|
678
685
|
*/
|
|
679
686
|
private sendSetPayloadEnvelope;
|
|
680
687
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mega-yfue/eufy-sdk",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.20",
|
|
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",
|