@mega-yfue/eufy-sdk 0.6.0-beta.44 → 0.6.0-beta.46

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.
@@ -21,18 +21,6 @@ export declare const CO_MEMBERS: {
21
21
  readonly provenance: "guessed";
22
22
  readonly description: "Carbon-monoxide detected. UNVERIFIED: placeholder id pending capture verification.";
23
23
  };
24
- /**
25
- * Unix seconds at which the detector last checked in — param 1551, the same last-seen id the other
26
- * sensor capabilities read. A `timestamp` kind takes no `unit`: the number is an instant, not a
27
- * duration, and declaring `unit: "s"` beside it fails the value-kind spec.
28
- */
29
- readonly lastSeen: {
30
- readonly param: 1551;
31
- readonly type: "number";
32
- readonly kind: "timestamp";
33
- readonly provenance: "verified";
34
- readonly description: "Last-seen unix timestamp, seconds (verified: param 1551).";
35
- };
36
24
  };
37
25
  /** Bound CO-detector reads — the object returned by `dev.co()`. Read-only. */
38
26
  export type CoActions = Surface<typeof CO_MEMBERS>;
@@ -34,8 +34,7 @@ export type EntryAlarmToneValue = (typeof EntryAlarmTone)[keyof typeof EntryAlar
34
34
  */
35
35
  export type ContactActions = Surface<typeof CONTACT_MEMBERS>;
36
36
  /**
37
- * Every `contact` feature, declared once. `contact` (1550) and `lastSeen` (1551) are verified reads;
38
- * the built-in alarm tone (1507) and volume (1508) are verified writes captured live on a T90E0.
37
+ * Every `contact` feature, declared once. `contact` (1550) is a verified read; the built-in alarm tone (1507) and volume (1508) are verified writes captured live on a T90E0.
39
38
  *
40
39
  * Exported but NOT published: each entry states its wire id and the evidence it was confirmed on,
41
40
  * which the reference site does not carry.
@@ -57,31 +56,6 @@ export declare const CONTACT_MEMBERS: {
57
56
  readonly provenance: "verified";
58
57
  readonly description: "Contact state, true=open (verified: param 1550 entry-sensor contact).";
59
58
  };
60
- /**
61
- * Unix seconds at which the sensor last checked in — the liveness read beside the contact state, and
62
- * the way to tell a genuinely closed door from a sensor that stopped reporting. A `timestamp` kind
63
- * takes no `unit`: it is an instant, not a duration.
64
- */
65
- readonly lastSeen: {
66
- readonly param: 1551;
67
- readonly type: "number";
68
- readonly kind: "timestamp";
69
- readonly provenance: "verified";
70
- readonly description: "Last-seen unix timestamp, seconds (verified: param 1551).";
71
- };
72
- /**
73
- * Link quality to whichever radio the sensor is paired over, in dBm as the device measures it. The
74
- * same param 1141 the other sub-1G sensors report on, so the number is comparable across them —
75
- * unlike a bars mapping, which this SDK never applies.
76
- */
77
- readonly rssi: {
78
- readonly param: 1141;
79
- readonly type: "number";
80
- readonly unit: "dBm";
81
- readonly kind: "dbm";
82
- readonly provenance: "verified";
83
- readonly description: "Sub-1G/Wi-Fi signal strength (verified: param 1141 = RSSI).";
84
- };
85
59
  /**
86
60
  * Rejected, not clamped, outside the tone enum: a fire-and-forget write of a bogus tone would look like
87
61
  * it worked. The wire is a direct-binary scalar `[ch][value][acct]` at signCode 8 — the app's own
@@ -131,7 +105,6 @@ export declare const CONTACT_MEMBERS: {
131
105
  };
132
106
  };
133
107
  /**
134
- * `contact` — entry/door-window sensor. `contact` (1550) and `lastSeen` (1551) are verified; the
135
- * built-in alarm tone (1507) and volume (1508) are verified writes captured live on a T90E0.
108
+ * `contact` — entry/door-window sensor. `contact` (1550) is verified; the built-in alarm tone (1507) and volume (1508) are verified writes captured live on a T90E0.
136
109
  */
137
110
  export declare const CONTACT: CapabilityModule;
@@ -37,6 +37,7 @@ import type { ContactActions } from "./contact.js";
37
37
  import type { LeakActions } from "./leak.js";
38
38
  import type { SmokeActions } from "./smoke.js";
39
39
  import type { CoActions } from "./co.js";
40
+ import type { LinkActions } from "./link.js";
40
41
  import type { KeypadActions } from "./keypad.js";
41
42
  import type { RtspActions } from "./rtsp.js";
42
43
  import type { VacuumCleanActions } from "./vacuum-clean.js";
@@ -411,16 +412,18 @@ export interface DeviceActionMap {
411
412
  doorbell: DoorbellActions;
412
413
  /** Motion/PIR: `setDetection(on)` (sensitivity is read-only until its write wire is captured). */
413
414
  motion: MotionActions;
414
- /** Entry (door/window) sensor: reads `open`, `lastSeen`, `rssi`, `alarmSoundType`, `alarmVolume`; writes `setAlarmSoundType`, `setAlarmVolume` (present when the sensor reports the alarm params). */
415
+ /** Entry (door/window) sensor: reads `open`, `alarmSoundType`, `alarmVolume`; writes `setAlarmSoundType`, `setAlarmVolume` (present when the sensor reports the alarm params). */
415
416
  contact: ContactActions;
416
- /** Water-leak / freeze sensor reads (read-only): `leakDetected`, `lastSeen`. */
417
+ /** Water-leak / freeze sensor reads (read-only): `leakDetected`. */
417
418
  leak: LeakActions;
418
- /** Smoke-detector reads (read-only): `smokeDetected`, `lastSeen`. */
419
+ /** Smoke-detector reads (read-only): `smokeDetected`. */
419
420
  smoke: SmokeActions;
420
- /** CO-detector reads (read-only): `coDetected`, `lastSeen`. */
421
+ /** CO-detector reads (read-only): `coDetected`. */
421
422
  co: CoActions;
422
- /** Security-keypad reads (read-only): `charging`, `rssi`. */
423
+ /** Security-keypad reads (read-only): `charging`. */
423
424
  keypad: KeypadActions;
425
+ /** Check-in and signal reads (read-only): `lastSeen`, `rssi`, each where the device reports it. */
426
+ link: LinkActions;
424
427
  /** RTSP publish for a NAS/NVR: `publish`/`withdraw` + `published`, `requireAuth`/`allowAnonymous`, `recordingMode`/`setRecordingMode`. One camera at a time per station. */
425
428
  rtsp: RtspActions;
426
429
  /** RoboVac core state and controls: `power`, `activity` (WorkStatus), `volume`, `battery`, `cleanType`; `setPower`, `startCleaning`, `returnToDock`, `pauseCleaning`. */
@@ -528,7 +531,7 @@ export type { ActionSpec } from "./types.js";
528
531
  * `undefined` for an action nothing describes.
529
532
  */
530
533
  export { actionSpecOf } from "./access.js";
531
- export type { PtzActions, LightActions, SmartLightActions, RgbColor, CameraActions, LockActions, SirenActions, ArmingActions, BatteryActions, MotionActions, ContactActions, LeakActions, SmokeActions, CoActions, KeypadActions, RtspActions, VacuumCleanActions, SuctionActions, MowerActions, LocateActions, SmartDropActions, };
534
+ export type { PtzActions, LightActions, SmartLightActions, RgbColor, CameraActions, LockActions, SirenActions, ArmingActions, BatteryActions, MotionActions, ContactActions, LeakActions, SmokeActions, CoActions, KeypadActions, LinkActions, RtspActions, VacuumCleanActions, SuctionActions, MowerActions, LocateActions, SmartDropActions, };
532
535
  /**
533
536
  * The member table each `*Actions` type is DERIVED from (`LockActions = Surface<typeof LOCK_MEMBERS>`),
534
537
  * so the type names the table and the table is part of the published surface.
@@ -545,6 +548,7 @@ export { CO_MEMBERS } from "./co.js";
545
548
  export { CONTACT_MEMBERS } from "./contact.js";
546
549
  export { DOORBELL_MEMBERS } from "./doorbell.js";
547
550
  export { KEYPAD_MEMBERS } from "./keypad.js";
551
+ export { LINK_MEMBERS } from "./link.js";
548
552
  export { LEAK_MEMBERS } from "./leak.js";
549
553
  export { LIGHT_MEMBERS } from "./light.js";
550
554
  export { LOCATE_MEMBERS } from "./locate.js";
@@ -2,8 +2,8 @@ import { isChargingState } from "./battery.js";
2
2
  import { type Surface } from "./members.js";
3
3
  import type { CapabilityModule } from "./types.js";
4
4
  /**
5
- * Every `keypad` feature, declared once. `rssi` is a verified read and `charging` follows the app's own
6
- * decode of the keypad's charger state.
5
+ * Every `keypad` feature, declared once. `charging` follows the app's own decode of the keypad's charger
6
+ * state.
7
7
  *
8
8
  * `batteryLow` is `unexposed`: the app maps its param to the same low-battery field the entry and motion
9
9
  * sensors feed, but its value decode is absent from the app's parser, so the polarity is not evidenced.
@@ -39,18 +39,6 @@ export declare const KEYPAD_MEMBERS: {
39
39
  readonly coerce: typeof isChargingState;
40
40
  readonly description: string;
41
41
  };
42
- /**
43
- * The keypad's link quality in dBm, on the same param 1141 the other sub-1G sensors report signal
44
- * strength on. Reported as the device measures it: raw dBm, never normalised to a bar count.
45
- */
46
- readonly rssi: {
47
- readonly param: 1141;
48
- readonly type: "number";
49
- readonly unit: "dBm";
50
- readonly kind: "dbm";
51
- readonly provenance: "verified";
52
- readonly description: "Keypad signal strength (verified: param 1141 = RSSI).";
53
- };
54
42
  };
55
43
  /** Bound keypad reads — the object returned by `dev.keypad()`. Read-only. */
56
44
  export type KeypadActions = Surface<typeof KEYPAD_MEMBERS>;
@@ -21,18 +21,6 @@ export declare const LEAK_MEMBERS: {
21
21
  readonly provenance: "guessed";
22
22
  readonly description: string;
23
23
  };
24
- /**
25
- * Unix seconds at which the sensor last checked in — param 1551, the same last-seen id the other
26
- * sensor capabilities read. A `timestamp` kind takes no `unit`: the number is an instant, not a
27
- * duration, and declaring `unit: "s"` beside it fails the value-kind spec.
28
- */
29
- readonly lastSeen: {
30
- readonly param: 1551;
31
- readonly type: "number";
32
- readonly kind: "timestamp";
33
- readonly provenance: "verified";
34
- readonly description: "Last-seen unix timestamp, seconds (verified: param 1551).";
35
- };
36
24
  };
37
25
  /** Bound leak-sensor reads — the object returned by `dev.leak()`. Read-only. */
38
26
  export type LeakActions = Surface<typeof LEAK_MEMBERS>;
@@ -0,0 +1,39 @@
1
+ import { type Surface } from "./members.js";
2
+ import type { CapabilityModule } from "./types.js";
3
+ /**
4
+ * Every `link` feature, declared once: the check-in and signal params a security device reports
5
+ * whatever it is (sensor, keypad, lock), each getter present only where the device reports its param.
6
+ * A capability with a reason to declare one of these properties itself takes precedence, since the
7
+ * first declaration of a property wins and `link` is registered after every device capability.
8
+ *
9
+ * Exported but NOT published: each entry states its wire id and the evidence it was confirmed on,
10
+ * which the reference site does not carry.
11
+ * @internal
12
+ */
13
+ export declare const LINK_MEMBERS: {
14
+ /**
15
+ * Unix seconds at which the device last checked in, as the device itself reports it — beside
16
+ * `deviceState(sn).lastSeenMs`, which the SDK derives from the cloud's own update times. A
17
+ * `timestamp` takes no `unit`: it is an instant, not a duration.
18
+ */
19
+ readonly lastSeen: {
20
+ readonly param: 1551;
21
+ readonly type: "number";
22
+ readonly kind: "timestamp";
23
+ readonly provenance: "verified";
24
+ readonly description: "Last-seen unix timestamp, seconds (verified: param 1551).";
25
+ };
26
+ /** Link quality in dBm as the device measures it, never normalised to a bar count. */
27
+ readonly rssi: {
28
+ readonly param: 1141;
29
+ readonly type: "number";
30
+ readonly unit: "dBm";
31
+ readonly kind: "dbm";
32
+ readonly provenance: "verified";
33
+ readonly description: "Sub-1G/Wi-Fi signal strength (verified: param 1141 = RSSI).";
34
+ };
35
+ };
36
+ /** Bound check-in and signal reads — the object returned by `dev.link()`. Read-only. */
37
+ export type LinkActions = Surface<typeof LINK_MEMBERS>;
38
+ /** `link` — the check-in timestamp and signal strength a security device reports. */
39
+ export declare const LINK: CapabilityModule;
@@ -101,18 +101,6 @@ export declare const LOCK_MEMBERS: {
101
101
  readonly provenance: "verified";
102
102
  readonly description: "Lock battery level 0-100 (verified: param 1101, alias 6001).";
103
103
  };
104
- /**
105
- * Link quality in dBm as the lock measures it, on the shared param 1141. On the `ff09` wire the
106
- * actuations are fire-and-forget, so a weak link is silent rather than an error.
107
- */
108
- readonly rssi: {
109
- readonly param: 1141;
110
- readonly type: "number";
111
- readonly unit: "dBm";
112
- readonly kind: "dbm";
113
- readonly provenance: "verified";
114
- readonly description: "Lock signal strength (verified: param 1141 = RSSI).";
115
- };
116
104
  /**
117
105
  * Lock the deadbolt/door. Resolves after sending, without confirming physical state — except on the
118
106
  * classic Wi-Fi lock, which answers: there it rejects on a device refusal or no reply as well.
@@ -21,18 +21,6 @@ export declare const SMOKE_MEMBERS: {
21
21
  readonly provenance: "guessed";
22
22
  readonly description: "Smoke detected. UNVERIFIED: placeholder id pending capture verification.";
23
23
  };
24
- /**
25
- * Unix seconds at which the detector last checked in — param 1551, the same last-seen id the other
26
- * sensor capabilities read. A `timestamp` kind takes no `unit`: the number is an instant, not a
27
- * duration, and declaring `unit: "s"` beside it fails the value-kind spec.
28
- */
29
- readonly lastSeen: {
30
- readonly param: 1551;
31
- readonly type: "number";
32
- readonly kind: "timestamp";
33
- readonly provenance: "verified";
34
- readonly description: "Last-seen unix timestamp, seconds (verified: param 1551).";
35
- };
36
24
  };
37
25
  /** Bound smoke-detector reads — the object returned by `dev.smoke()`. Read-only. */
38
26
  export type SmokeActions = Surface<typeof SMOKE_MEMBERS>;
@@ -178,6 +178,12 @@ export interface EventClaim {
178
178
  * and ignored where that is absent.
179
179
  */
180
180
  homeBaseAttached?: boolean;
181
+ /**
182
+ * Thing-description property identifiers whose presence is the evidence: the product's description,
183
+ * resolved for this device, lists at least one of them. Compared against
184
+ * {@link AvailabilityContext.things}, and ignored where that is absent.
185
+ */
186
+ things?: readonly string[];
181
187
  }
182
188
  /**
183
189
  * A decoded inbound event a capability wants surfaced on the SDK. `event` is the EufyMega event
@@ -86,6 +86,8 @@ export declare class Device {
86
86
  * answers a caller has to be able to tell apart.
87
87
  */
88
88
  private bound;
89
+ /** The product's thing description resolved for this device, as {@link bindActions} was given it. */
90
+ private things?;
89
91
  /**
90
92
  * Read-through freshness policy (injected by the facade via {@link setFreshnessPolicy}; the model
91
93
  * stays transport-free — it only calls the supplied `refresh`). Default: caching OFF
@@ -40,7 +40,7 @@ export type Codec = "station" | "camera" | "sensor" | "lock" | "keypad" | "vacuu
40
40
  * it maps to a {@link CapabilityModule} that owns its property schema. Extend this union as
41
41
  * new capabilities are modelled — adding one never requires a subclass.
42
42
  */
43
- export type Capability = "video" | "snapshot" | "motion" | "person_detection" | "battery" | "light" | "ptz" | "doorbell" | "contact" | "leak" | "smoke" | "co" | "siren" | "lock" | "keypad" | "arming" | "storage" | "rtsp" | "camera" | "audio" | "vacuum_clean" | "vacuum_dock" | "suction" | "locate" | "mower" | "smart_drop" | "smart_light" | "display" | "info";
43
+ export type Capability = "video" | "snapshot" | "motion" | "person_detection" | "battery" | "light" | "ptz" | "doorbell" | "contact" | "leak" | "smoke" | "co" | "siren" | "lock" | "keypad" | "link" | "arming" | "storage" | "rtsp" | "camera" | "audio" | "vacuum_clean" | "vacuum_dock" | "suction" | "locate" | "mower" | "smart_drop" | "smart_light" | "display" | "info";
44
44
  /** Value type of a property. */
45
45
  export type PropertyValueType = "bool" | "number" | "string" | "enum";
46
46
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mega-yfue/eufy-sdk",
3
- "version": "0.6.0-beta.44",
3
+ "version": "0.6.0-beta.46",
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",