@mega-yfue/eufy-sdk 0.5.0-beta.65 → 0.5.0-beta.66

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 CHANGED
@@ -7756,6 +7756,8 @@ var ARMING_CMD = {
7756
7756
  * The ENCRYPTION LEVEL is the session's to pick (`"auto"`), not this command's: the T8030 the envelope
7757
7757
  * was captured on holds a level-2 key and seals it level-2, while an own-session camera that never
7758
7758
  * negotiates one carries the same envelope level-1. See `armingCommand`.
7759
+ *
7760
+ * A T8410C takes the mode as a direct frame instead of this envelope; see {@link DIRECT_ARMING_MODELS}.
7759
7761
  */
7760
7762
  SET_ARMING: 1224,
7761
7763
  /**
@@ -7794,6 +7796,8 @@ var ARMING_CMD = {
7794
7796
  };
7795
7797
  var DEVICE_NOTIFY_FLAG = 8;
7796
7798
  var STANDALONE_ACTION_MODELS = /* @__PURE__ */ new Set(["T8170", "T8171"]);
7799
+ var DIRECT_ARMING_MODELS = /* @__PURE__ */ new Set(["T8410C"]);
7800
+ var DIRECT_ARMING_MODES = /* @__PURE__ */ new Set(["away", "home", "disarmed"]);
7797
7801
  var STANDALONE_READ_MODELS = /* @__PURE__ */ new Set([...STANDALONE_ACTION_MODELS, "T8400", "T8442", "T8410"]);
7798
7802
  function ownAction(read, mode) {
7799
7803
  const value = Number(read(`${mode}Action`)?.value);
@@ -7826,6 +7830,12 @@ function armingCommand(mode, ctx) {
7826
7830
  if (!ctx.accountName) {
7827
7831
  throw new Error(`arming: missing account identity (user_name) [${describeDevice(ctx)}]`);
7828
7832
  }
7833
+ if (DIRECT_ARMING_MODELS.has(ctx.model ?? "")) {
7834
+ if (!DIRECT_ARMING_MODES.has(mode)) {
7835
+ throw new Error(`arming: mode ${mode} is unconfirmed on the direct 1224 frame [${describeDevice(ctx)}]`);
7836
+ }
7837
+ return setStationScalar(ARMING_CMD.SET_ARMING, ARMING_MODE_WIRE[mode], ctx.channel);
7838
+ }
7829
7839
  return setPayload(ARMING_CMD.SET_ARMING, { mode_type: ARMING_MODE_WIRE[mode], user_name: ctx.accountName }, ctx, 0, void 0, "auto");
7830
7840
  }
7831
7841
  function alarmDelayCommand(mode, config, ctx) {
@@ -7880,7 +7890,7 @@ var ARMING_MEMBERS = {
7880
7890
  kind: "enum",
7881
7891
  enumValues: ARMING_MODE_LABELS,
7882
7892
  provenance: "verified",
7883
- 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.",
7893
+ 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. On a T8410C only away, home and disarmed are writable.",
7884
7894
  observation: {
7885
7895
  event: "armingModeChanged",
7886
7896
  reflects: (value) => ({ param: ARMING_CMD.SET_ARMING, expected: ARMING_MODE_WIRE[armingModeOf(value)] }),