@mega-yfue/eufy-sdk 0.6.0-beta.24 → 0.6.0-beta.26

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.
@@ -76,9 +76,10 @@ export declare function setJsonRaw(cmd: number, data: Record<string, unknown>, c
76
76
  export declare function setPayload(cmd: number, payload: Record<string, unknown>, ctx: CommandContext, mValue3?: number, channel?: number, form?: ScalarForm): Command;
77
77
  /**
78
78
  * Set a station-scoped scalar (132-byte body, no channel field) on an EXPLICIT channel — for the
79
- * HomeBase's own controls on the station broadcast channel 255 (alarm/speaker volume 1235).
79
+ * HomeBase's own controls on the station broadcast channel 255 (alarm/speaker volume 1235). Level-2
80
+ * only, unless `form` is `"auto"`, which seals it at the session's own level.
80
81
  */
81
- export declare function setStationScalar(cmd: number, value: number, channel: number): Command;
82
+ export declare function setStationScalar(cmd: number, value: number, channel: number, form?: "auto"): Command;
82
83
  /**
83
84
  * A one-line device descriptor for error messages — carries every identifier needed to reproduce or
84
85
  * triage from a log later (deviceType, model T-code, full serial, channel, codec), so a "capability
@@ -77,7 +77,8 @@ export declare const ARMING_CMD: {
77
77
  * was captured on holds a level-2 key and seals it level-2, while an own-session camera that never
78
78
  * negotiates one carries the same envelope level-1. See `armingCommand`.
79
79
  *
80
- * A T8410C takes the mode as a direct frame instead of this envelope; see {@link DIRECT_ARMING_MODELS}.
80
+ * A T8410C and a T8410 take the mode as a direct frame instead of this envelope; see
81
+ * {@link DIRECT_ARMING_MODELS} and {@link BROADCAST_ARMING_MODELS}.
81
82
  */
82
83
  readonly SET_ARMING: 1224;
83
84
  /**
@@ -170,7 +170,7 @@ export declare const BATTERY_MEMBERS: {
170
170
  /**
171
171
  * 1293 is the READABLE indicator (6445 is write-only/cloud-hidden). Verified live on a T8124R via an
172
172
  * app-toggle before/after diff: 0 = Battery, 1 = External Solar Panel. Values beyond 0/1 (some models
173
- * report 5) are shown raw — `enumValues` only labels the two that are confirmed.
173
+ * report 5) read as `undefined` — `enumValues` holds only the two that are confirmed.
174
174
  *
175
175
  * The write is a `1350` SET_PAYLOAD, inner cmd 1293, `{charge_mode:N}`, `mValue3` 0 (the app uses 0,
176
176
  * not the cmd id), and the setter accepts a NAME as well as the index the getter answers.
@@ -439,6 +439,10 @@ export declare const CAMERA_MEMBERS: {
439
439
  * sensor omits it, and the wire accepts the value regardless — the device's own reported set is the
440
440
  * only statement of which of the three it has. `coerceEnumValue` rejects a value outside
441
441
  * {@link NightVision} rather than coercing it. The payload key on the wire is `night_sion`.
442
+ *
443
+ * 1277 carries more than these three on some models: the V6 app's per-model mappings put modes on
444
+ * 3, 5, 6 and 8 as well, and which model takes which mapping is not in the app bundle. A reported value
445
+ * outside the published options reads as `undefined` rather than as an unnamed number.
442
446
  */
443
447
  readonly nightVision: {
444
448
  readonly param: 1277;
@@ -576,12 +576,14 @@ export declare function memberWrite(name: string, m: ValueMember, value: boolean
576
576
  * is stored as a decoded object. Handing either through a getter typed `number` is the one lie this
577
577
  * table exists to prevent.
578
578
  *
579
+ * A number outside `values`, the options published for this device, answers `undefined`.
580
+ *
579
581
  * Exported so the ONE narrowing the getters use is also the one a property-change announcement carries.
580
582
  * A second conversion of the wire value is precisely how a payload comes to disagree with the getter
581
583
  * beside it, which would defeat the point of announcing the change at all.
582
584
  * @internal
583
585
  */
584
- export declare function narrow(type: PropertyValueType, read: CapabilityStateReader, prop: string): boolean | number | string | undefined;
586
+ export declare function narrow(type: PropertyValueType, read: CapabilityStateReader, prop: string, values?: Record<number, string>): boolean | number | string | undefined;
585
587
  /**
586
588
  * Both presence gates at once: the params a member requires, and its own {@link ValueMember.available}.
587
589
  *
@@ -718,6 +718,9 @@ export declare class P2PCommandRouter {
718
718
  * **Station-scoped scalar** (`p2p-station-scalar` intent): the 132-byte channel-less body
719
719
  * ({@link buildDirectBinaryBody} with no `channel`) on an EXPLICIT channel, signCode 8. The
720
720
  * HomeBase's own controls ride the station broadcast channel 255 (alarm/speaker volume 1235).
721
+ *
722
+ * `form` `"auto"` seals it at the session's level, as {@link sendBySessionLevel} defines it: level-2 on a
723
+ * keyed session, the same body sealed level-1 on a keyless one. Absent, the send waits for the level-2 key.
721
724
  */
722
725
  private sendStationScalar;
723
726
  /** Send a level-1 int-plus-string frame with authenticated account identity injected by the transport. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mega-yfue/eufy-sdk",
3
- "version": "0.6.0-beta.24",
3
+ "version": "0.6.0-beta.26",
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",