@mega-yfue/eufy-sdk 0.2.0-beta.7 → 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.
@@ -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 — the four whose write is confirmed against a real station. Three are
6
- * byte-exact captures and `custom1` is a live confirmation; `ARMING_MODE_WIRE` carries the per-value
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
- * Deliberately NARROWER than the set a device may report. The remaining five modes are ones the app itself
14
- * defines and the `mode` read still names them, but no capture shows one being SENT — and
15
- * on a fire-and-forget wire a wrong one looks exactly like success. Leaving them out of this union is the
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. `custom1` 3 joined {@link ArmingMode} on a live confirmation rather than a
64
- * capture, making four settable in total. The remaining five are named by the app but never observed
65
- * leaving it, so this capability reads them and refuses to send them. See `ARMING_MODE_WIRE` for the
66
- * per-value breakdown.
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
- * The one member whose write domain is NARROWER than its read: `enumValues` names all nine modes a
168
- * station can report, and the argument's `values` publishes only the four whose write is confirmed. That
169
- * argument IS the domain the derived setter enforces and the refusal names, so an unconfirmed mode is
170
- * refused by naming the four that work — nine labels for the read and four for the write, off one
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
- * read/write MECHANISM, but only 4 of the 9 modes it reports (away/home/custom1/disarmed, the
226
- * {@link ArmingMode} union) are confirmed as writes — see `ARMING_MODE_WIRE` for which 5 are still
227
- * unverified third-party integers, and which of the 4 is live-confirmed rather than byte-captured.
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.7",
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",
@@ -64,7 +64,8 @@
64
64
  "guard:docrefs": "bash scripts/ci/guard-doc-refs.sh",
65
65
  "guard:lines": "bash scripts/ci/guard-lines.sh",
66
66
  "check:esm": "node -e \"import('./dist/index.js').then(m=>console.log('ESM OK:',Object.keys(m).length,'exports'))\"",
67
- "verify": "npm run format:check && npm run typecheck && npm run guard:decorrelation && npm run guard:lines && npm run guard:docrefs && npm run guard:consumer-agnostic && npm run guard:capability-ownership && npm run build && npm run check:esm && npm run typecheck:examples && npm test",
67
+ "check:snippets": "node scripts/ci/check-doc-snippets.mjs",
68
+ "verify": "npm run format:check && npm run typecheck && npm run guard:decorrelation && npm run guard:lines && npm run guard:docrefs && npm run guard:consumer-agnostic && npm run guard:capability-ownership && npm run build && npm run check:esm && npm run check:snippets && npm run typecheck:examples && npm test",
68
69
  "release": "bash scripts/release.sh"
69
70
  },
70
71
  "engines": {