@mega-yfue/eufy-sdk 0.2.0-beta.8 → 0.2.0-beta.9
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 +20 -19
- package/dist/index.js.map +2 -2
- package/dist/model/capabilities/arming.d.ts +29 -27
- package/package.json +1 -1
|
@@ -2,27 +2,35 @@ import { type Surface } from "./members.js";
|
|
|
2
2
|
import type { CapabilityModule, CommandContext } from "./types.js";
|
|
3
3
|
import type { Command } from "../../core/contracts.js";
|
|
4
4
|
/**
|
|
5
|
-
* The guard modes `setMode` can SET —
|
|
6
|
-
*
|
|
7
|
-
* evidence. `ArmingMode` is both the const value-object (`ArmingMode.home`) and the union type of its
|
|
5
|
+
* The guard modes `setMode` can SET — every mode a station reports, all nine confirmed against real
|
|
6
|
+
* hardware. `ArmingMode` is both the const value-object (`ArmingMode.home`) and the union type of its
|
|
8
7
|
* values, so callers pass the named constant: `setMode(ArmingMode.home)`.
|
|
9
8
|
*
|
|
10
9
|
* The domain of `setMode` (cmd 1224) alone. The alarm-delay write (cmd 1255) carries its own mode integer
|
|
11
|
-
* on a separate wire and takes {@link AlarmDelayMode}
|
|
10
|
+
* on a separate wire and takes {@link AlarmDelayMode}, which stays NARROWER — evidence for one command is
|
|
11
|
+
* not evidence for the other, and 1255 still has no capture beyond its byte-captured three.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* compile-time half of the refusal; `mode`'s published argument and the generated rejection are the
|
|
17
|
-
* runtime half.
|
|
13
|
+
* A mode belongs here only once its write is confirmed against real hardware, because a fire-and-forget
|
|
14
|
+
* wire makes a wrong mode look exactly like success; `ARMING_MODE_WIRE` carries the per-value evidence.
|
|
15
|
+
* The union is also what `ARMING_MODE_WIRE` is keyed by, so the table cannot name a mode this does not.
|
|
18
16
|
*/
|
|
19
17
|
export declare const ArmingMode: {
|
|
20
18
|
/** Armed — full protection, nobody home (wire value 0). */
|
|
21
19
|
readonly away: "away";
|
|
22
20
|
/** Armed for occupancy — reduced/perimeter protection while home (wire value 1). */
|
|
23
21
|
readonly home: "home";
|
|
22
|
+
/** Scheduled — the station follows the timetable configured in the app (wire value 2). */
|
|
23
|
+
readonly schedule: "schedule";
|
|
24
24
|
/** Custom 1 — a user-defined posture configured in the app (wire value 3). */
|
|
25
25
|
readonly custom1: "custom1";
|
|
26
|
+
/** Custom 2 — a user-defined posture configured in the app (wire value 4). */
|
|
27
|
+
readonly custom2: "custom2";
|
|
28
|
+
/** Custom 3 — a user-defined posture configured in the app (wire value 5). */
|
|
29
|
+
readonly custom3: "custom3";
|
|
30
|
+
/** Off — the station's alarm system is switched off entirely (wire value 6). */
|
|
31
|
+
readonly off: "off";
|
|
32
|
+
/** Geofenced — the station follows the app's location-based rules (wire value 47). */
|
|
33
|
+
readonly geo: "geo";
|
|
26
34
|
/** Disarmed — no alarms; sensors still report state (wire value 63). */
|
|
27
35
|
readonly disarmed: "disarmed";
|
|
28
36
|
};
|
|
@@ -60,10 +68,10 @@ export declare const ARMING_CMD: {
|
|
|
60
68
|
*
|
|
61
69
|
* ⚠️ Only 3 of the 9 modes were exercised in that capture — `mode_type` 0 (away), 63 (disarmed), 1
|
|
62
70
|
* (home), all confirmed byte-exact. Re-confirmed live 2026-08-05: each reported its own MODE_SWITCH push
|
|
63
|
-
* within ~5s of the write.
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* per-value
|
|
71
|
+
* within ~5s of the write. The remaining six are live confirmations rather than captures — `custom1` 3
|
|
72
|
+
* first, then `schedule` 2, `custom2` 4, `custom3` 5, `off` 6 and `geo` 47 — each sent as this exact
|
|
73
|
+
* frame and each observed to bring MODE_SWITCH back, so all nine are settable. `ARMING_MODE_WIRE` has
|
|
74
|
+
* the per-value evidence and the dates.
|
|
67
75
|
*/
|
|
68
76
|
readonly SET_ARMING: 1224;
|
|
69
77
|
/**
|
|
@@ -164,11 +172,10 @@ export type ArmingActions = Surface<typeof ARMING_MEMBERS>;
|
|
|
164
172
|
*/
|
|
165
173
|
export declare const ARMING_MEMBERS: {
|
|
166
174
|
/**
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* declaration.
|
|
175
|
+
* Read and write are the same nine modes, so `enumValues` is the whole domain: `writeDomain` falls back
|
|
176
|
+
* to it, and the derived setter, the refusal message and the offered argument all read from that one
|
|
177
|
+
* declaration. A member states an `args` entry only where the two sides DIFFER. See
|
|
178
|
+
* {@link ARMING_MODE_WIRE} for the per-value evidence.
|
|
172
179
|
*
|
|
173
180
|
* `armingCommand` may also throw synchronously (missing account identity) and `bindMembers` turns that
|
|
174
181
|
* into a rejection, so the builder stays plain.
|
|
@@ -188,11 +195,6 @@ export declare const ARMING_MEMBERS: {
|
|
|
188
195
|
readonly kind: "enum";
|
|
189
196
|
readonly enumValues: Record<number, string>;
|
|
190
197
|
readonly provenance: "verified";
|
|
191
|
-
readonly args: readonly [{
|
|
192
|
-
readonly name: "mode";
|
|
193
|
-
readonly kind: "enum";
|
|
194
|
-
readonly values: readonly number[];
|
|
195
|
-
}];
|
|
196
198
|
readonly description: string;
|
|
197
199
|
readonly observation: {
|
|
198
200
|
readonly event: "armingModeChanged";
|
|
@@ -221,9 +223,9 @@ export declare const ARMING_MEMBERS: {
|
|
|
221
223
|
readonly setAlarmDelayConfig: import("./members.js").MethodMember<(mode: AlarmDelayMode, config: AlarmDelayConfig) => Promise<void>>;
|
|
222
224
|
};
|
|
223
225
|
/**
|
|
224
|
-
* `arming` — guard/arming mode. `armingMode` (see {@link ARMING_CMD.SET_ARMING}) has a verified
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
226
|
+
* `arming` — guard/arming mode. `armingMode` (see {@link ARMING_CMD.SET_ARMING}) has a verified read/write
|
|
227
|
+
* MECHANISM, and all 9 modes it reports are now confirmed as writes — the {@link ArmingMode} union is the
|
|
228
|
+
* whole set. See `ARMING_MODE_WIRE` for which three are byte-captured and which six are live-confirmed.
|
|
229
|
+
* The alarm-delay write (cmd 1255) is unaffected and keeps its narrower {@link AlarmDelayMode}.
|
|
228
230
|
*/
|
|
229
231
|
export declare const ARMING: CapabilityModule;
|
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.9",
|
|
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",
|