@mega-yfue/eufy-sdk 0.4.0-beta.30 → 0.4.0-beta.32

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.
@@ -1,5 +1,5 @@
1
1
  import { type Surface } from "./members.js";
2
- import type { CapabilityModule, CommandContext } from "./types.js";
2
+ import type { AvailabilityContext, CapabilityModule, CommandContext } from "./types.js";
3
3
  import { type Command, type MediaProvider } from "../../core/contracts.js";
4
4
  /**
5
5
  * The P2P **feature-command ids** this camera capability drives (direct-binary switches + `1350`
@@ -8,8 +8,10 @@ import { type Command, type MediaProvider } from "../../core/contracts.js";
8
8
  * `transport/p2p/commands.ts`). Each entry notes its app `CommandType` name.
9
9
  */
10
10
  export declare const CAMERA_CMD: {
11
- /** Camera on/off. switch is inverted: camera ON ⇒ 0, OFF ⇒ 1. */
11
+ /** Camera on/off. Read and write polarity depend on the family and topology. */
12
12
  readonly CAMERA_ENABLE: 1035;
13
+ /** Wrapped T8410 power switch on HomeBase 3. */
14
+ readonly PRIVACY_MODE: 6250;
13
15
  /**
14
16
  * Camera status LED on/off — the "power/recording" indicator. The
15
17
  * app JS has a sibling param `1056` (`APP_CMD_LIVEVIEW_LED_SWITCH`) for the SAME UI "Status Light"
@@ -270,17 +272,17 @@ export type CameraActions = Surface<typeof CAMERA_MEMBERS> & {
270
272
  */
271
273
  export declare const CAMERA_MEMBERS: {
272
274
  /**
273
- * The READ is the *disable*-bit convention (1035 "0" ⇒ ON, 2001 direct); the WRITE polarity is
275
+ * The default READ is the *disable*-bit convention (1035 "0" ⇒ ON, 2001 direct); the WRITE polarity is
274
276
  * family-dependent — see `powerValue` / `isEnableBitPolarity`. Battery/solo cams report the state under
275
277
  * 1035, standalone indoor/outdoor cams under 2001 OPEN_DEVICE with direct polarity, so 2001 is a
276
278
  * read-alias. Both verified live, and the write polarity is confirmed against the app's own frames.
277
279
  *
278
- * The read and the setter observe the SAME wire on every family — see `powerCommand` — which is what
279
- * makes this value track what it is told, and what lets `enablementReflection` confirm a write.
280
+ * T8410 on HomeBase 3 reports 1035 as an enable bit ("1" ⇒ ON). That reported state does not reliably
281
+ * reflect the privacy command. `readReflectsWrite` states this distinction.
280
282
  *
281
283
  * The privacy param (6250) is reported by the outdoor-PT family and by no other camera measured, and both
282
284
  * of its polarities are observed. It is deliberately NOT aliased here: it moved in the same step as 1035, so
283
- * the reading cannot say whether power and privacy are one state or two, and the app drives 1035 — so
285
+ * the reading cannot say whether power and privacy are one state or two — so
284
286
  * aliasing a second param could only fold two possible states into one getter for no gain.
285
287
  */
286
288
  readonly enabled: {
@@ -289,10 +291,12 @@ export declare const CAMERA_MEMBERS: {
289
291
  readonly kind: "boolean";
290
292
  readonly provenance: "verified";
291
293
  readonly invert: true;
294
+ readonly invertFor: (ctx: AvailabilityContext) => false | undefined;
292
295
  readonly readAliases: readonly [{
293
296
  readonly paramType: 2001;
294
297
  readonly invert: false;
295
298
  }];
299
+ readonly readReflectsWrite: (ctx: CommandContext) => boolean;
296
300
  readonly description: string;
297
301
  readonly observation: {
298
302
  readonly event: "cameraEnabledChanged";
@@ -512,10 +516,10 @@ export declare const CAMERA_MEMBERS: {
512
516
  readonly type: "bool";
513
517
  readonly kind: "boolean";
514
518
  readonly provenance: "verified";
515
- readonly readAvailable: (ctx: import("./types.js").AvailabilityContext) => boolean;
519
+ readonly readAvailable: (ctx: AvailabilityContext) => boolean;
516
520
  readonly readAliases: readonly [{
517
521
  readonly paramType: 1716;
518
- readonly available: (ctx: import("./types.js").AvailabilityContext) => boolean;
522
+ readonly available: (ctx: AvailabilityContext) => boolean;
519
523
  }];
520
524
  readonly requiresRead: true;
521
525
  readonly description: "Camera status LED. Video doorbells report the same state under their button-ring LED parameter.";
@@ -526,7 +530,7 @@ export declare const CAMERA_MEMBERS: {
526
530
  * value, and it exists only on a device bound to a provider. Each is declared once, with its
527
531
  * signature taken FROM {@link MediaProvider} — so a change there is a compile error here, not a drift.
528
532
  *
529
- * Every pull is refused where {@link CAMERA_MEMBERS.enabled} reads false, with {@link CameraDisabledError} —
533
+ * Every pull is refused where a reliable {@link CAMERA_MEMBERS.enabled} reads false, with {@link CameraDisabledError} —
530
534
  * `live`, `snapshotLive`, `record`, `openReadable` and `recordFragments` alike, since each opens media on a
531
535
  * camera that serves none. That reading is the on/off source; a live probe is not one, since a disabled
532
536
  * camera answers a start with audio and never a video frame.
@@ -48,6 +48,8 @@ export interface ValueMember {
48
48
  enumValuesFor?: (ctx: AvailabilityContext) => Record<number, string> | undefined;
49
49
  provenance?: PropertySpec["provenance"];
50
50
  invert?: boolean;
51
+ /** Per-device read polarity; undefined retains the static default. */
52
+ invertFor?: (ctx: AvailabilityContext) => boolean | undefined;
51
53
  description: string;
52
54
  /** The wire, or absent for read-only. `undefined` from it = this value is not one we accept. */
53
55
  write?: (value: boolean | number | string, ctx: CommandContext) => Command | undefined;
@@ -245,6 +245,8 @@ export interface AvailabilityContext {
245
245
  * cannot do what its name promises there.
246
246
  */
247
247
  homeBaseAttached?: boolean;
248
+ /** Serial of the covering station, when the device record names one. */
249
+ stationSerial?: string;
248
250
  }
249
251
  export interface CommandContext extends AvailabilityContext {
250
252
  /** Device channel (0 for standalone, `device_channel` on a HomeBase). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mega-yfue/eufy-sdk",
3
- "version": "0.4.0-beta.30",
3
+ "version": "0.4.0-beta.32",
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",