@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
package/dist/index.js
CHANGED
|
@@ -6916,8 +6916,18 @@ var ArmingMode = {
|
|
|
6916
6916
|
away: "away",
|
|
6917
6917
|
/** Armed for occupancy — reduced/perimeter protection while home (wire value 1). */
|
|
6918
6918
|
home: "home",
|
|
6919
|
+
/** Scheduled — the station follows the timetable configured in the app (wire value 2). */
|
|
6920
|
+
schedule: "schedule",
|
|
6919
6921
|
/** Custom 1 — a user-defined posture configured in the app (wire value 3). */
|
|
6920
6922
|
custom1: "custom1",
|
|
6923
|
+
/** Custom 2 — a user-defined posture configured in the app (wire value 4). */
|
|
6924
|
+
custom2: "custom2",
|
|
6925
|
+
/** Custom 3 — a user-defined posture configured in the app (wire value 5). */
|
|
6926
|
+
custom3: "custom3",
|
|
6927
|
+
/** Off — the station's alarm system is switched off entirely (wire value 6). */
|
|
6928
|
+
off: "off",
|
|
6929
|
+
/** Geofenced — the station follows the app's location-based rules (wire value 47). */
|
|
6930
|
+
geo: "geo",
|
|
6921
6931
|
/** Disarmed — no alarms; sensors still report state (wire value 63). */
|
|
6922
6932
|
disarmed: "disarmed"
|
|
6923
6933
|
};
|
|
@@ -6938,10 +6948,10 @@ var ARMING_CMD = {
|
|
|
6938
6948
|
*
|
|
6939
6949
|
* ⚠️ Only 3 of the 9 modes were exercised in that capture — `mode_type` 0 (away), 63 (disarmed), 1
|
|
6940
6950
|
* (home), all confirmed byte-exact. Re-confirmed live 2026-08-05: each reported its own MODE_SWITCH push
|
|
6941
|
-
* within ~5s of the write.
|
|
6942
|
-
*
|
|
6943
|
-
*
|
|
6944
|
-
* per-value
|
|
6951
|
+
* within ~5s of the write. The remaining six are live confirmations rather than captures — `custom1` 3
|
|
6952
|
+
* first, then `schedule` 2, `custom2` 4, `custom3` 5, `off` 6 and `geo` 47 — each sent as this exact
|
|
6953
|
+
* frame and each observed to bring MODE_SWITCH back, so all nine are settable. `ARMING_MODE_WIRE` has
|
|
6954
|
+
* the per-value evidence and the dates.
|
|
6945
6955
|
*/
|
|
6946
6956
|
SET_ARMING: 1224,
|
|
6947
6957
|
/**
|
|
@@ -6975,20 +6985,14 @@ var ARMING_MODE_WIRE = {
|
|
|
6975
6985
|
away: 0,
|
|
6976
6986
|
home: 1,
|
|
6977
6987
|
schedule: 2,
|
|
6978
|
-
// ⚠️ reportable, NOT settable — see the doc comment above
|
|
6979
6988
|
custom1: 3,
|
|
6980
6989
|
custom2: 4,
|
|
6981
|
-
// ⚠️ reportable, NOT settable — see the doc comment above
|
|
6982
6990
|
custom3: 5,
|
|
6983
|
-
// ⚠️ reportable, NOT settable — see the doc comment above
|
|
6984
6991
|
off: 6,
|
|
6985
|
-
// ⚠️ reportable, NOT settable — see the doc comment above
|
|
6986
6992
|
geo: 47,
|
|
6987
|
-
// ⚠️ reportable, NOT settable — see the doc comment above
|
|
6988
6993
|
disarmed: 63
|
|
6989
6994
|
};
|
|
6990
6995
|
var ARMING_MODE_LABELS = enumLabels(ARMING_MODE_WIRE);
|
|
6991
|
-
var SETTABLE_MODES = Object.values(ArmingMode).map((m) => ARMING_MODE_WIRE[m]);
|
|
6992
6996
|
function armingModeOf(v) {
|
|
6993
6997
|
const name = String(v);
|
|
6994
6998
|
if (name in ArmingMode)
|
|
@@ -6997,11 +7001,10 @@ function armingModeOf(v) {
|
|
|
6997
7001
|
return Object.values(ArmingMode).find((m) => ARMING_MODE_WIRE[m] === wire);
|
|
6998
7002
|
}
|
|
6999
7003
|
function armingCommand(mode, ctx) {
|
|
7000
|
-
const modeType = ARMING_MODE_WIRE[mode];
|
|
7001
7004
|
if (!ctx.accountName) {
|
|
7002
7005
|
throw new Error(`arming: missing account identity (user_name) [${describeDevice(ctx)}]`);
|
|
7003
7006
|
}
|
|
7004
|
-
return setPayload(ARMING_CMD.SET_ARMING, { mode_type:
|
|
7007
|
+
return setPayload(ARMING_CMD.SET_ARMING, { mode_type: ARMING_MODE_WIRE[mode], user_name: ctx.accountName }, ctx, 0);
|
|
7005
7008
|
}
|
|
7006
7009
|
function alarmDelayCommand(mode, config, ctx) {
|
|
7007
7010
|
const data = {
|
|
@@ -7018,11 +7021,10 @@ function alarmDelayCommand(mode, config, ctx) {
|
|
|
7018
7021
|
}
|
|
7019
7022
|
var ARMING_MEMBERS = {
|
|
7020
7023
|
/**
|
|
7021
|
-
*
|
|
7022
|
-
*
|
|
7023
|
-
*
|
|
7024
|
-
*
|
|
7025
|
-
* declaration.
|
|
7024
|
+
* Read and write are the same nine modes, so `enumValues` is the whole domain: `writeDomain` falls back
|
|
7025
|
+
* to it, and the derived setter, the refusal message and the offered argument all read from that one
|
|
7026
|
+
* declaration. A member states an `args` entry only where the two sides DIFFER. See
|
|
7027
|
+
* {@link ARMING_MODE_WIRE} for the per-value evidence.
|
|
7026
7028
|
*
|
|
7027
7029
|
* `armingCommand` may also throw synchronously (missing account identity) and `bindMembers` turns that
|
|
7028
7030
|
* into a rejection, so the builder stays plain.
|
|
@@ -7041,8 +7043,7 @@ var ARMING_MEMBERS = {
|
|
|
7041
7043
|
kind: "enum",
|
|
7042
7044
|
enumValues: ARMING_MODE_LABELS,
|
|
7043
7045
|
provenance: "verified",
|
|
7044
|
-
|
|
7045
|
-
description: "Guard mode (verified: param 1224 = GUARD_MODE, read/write mechanism confirmed). Reads all 9 modes the app defines; SETS only the 4 whose write is confirmed (away/home/custom1/disarmed) \u2014 schedule/custom2/custom3/off/geo are named by the app but no capture shows one being sent, so they are refused rather than guessed; see ARMING_MODE_WIRE in arming.ts for the breakdown.",
|
|
7046
|
+
description: "Guard mode (verified: param 1224 = GUARD_MODE, read/write mechanism confirmed). Reads and SETS all 9 modes the app defines \u2014 away/home/schedule/custom1/custom2/custom3/off/geo/disarmed. Three are byte-captured writes and six are live-confirmed (each sent and observed to report its own MODE_SWITCH); see ARMING_MODE_WIRE in arming.ts for the per-value evidence.",
|
|
7046
7047
|
observation: {
|
|
7047
7048
|
event: "armingModeChanged",
|
|
7048
7049
|
reflects: (value) => ({ param: ARMING_CMD.SET_ARMING, expected: ARMING_MODE_WIRE[armingModeOf(value)] }),
|