@mega-yfue/eufy-sdk 0.5.0-beta.70 → 0.5.0-beta.71
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/core/contracts.d.ts +1 -0
- package/dist/index.js +83 -12
- package/dist/index.js.map +2 -2
- package/dist/model/capabilities/lock.d.ts +21 -7
- package/dist/model/capabilities/types.d.ts +4 -0
- package/dist/model/device-family.d.ts +2 -0
- package/dist/transport/p2p/command-router.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Surface } from "./members.js";
|
|
2
2
|
import type { AvailabilityContext, CapabilityModule, CommandContext } from "./types.js";
|
|
3
|
-
import type { Command, AutoLockSnapshot } from "../../core/contracts.js";
|
|
3
|
+
import type { Command, AutoLockSnapshot, MediaProvider } from "../../core/contracts.js";
|
|
4
4
|
/**
|
|
5
5
|
* Setting-id selectors for the compact `ff09-setting-toggle` write — this capability's OWN wire
|
|
6
6
|
* vocabulary, named not inlined per the capability wire-id convention, so `setRainMode`
|
|
@@ -107,10 +107,14 @@ export declare const LOCK_MEMBERS: {
|
|
|
107
107
|
readonly provenance: "verified";
|
|
108
108
|
readonly description: "Lock signal strength (verified: param 1141 = RSSI).";
|
|
109
109
|
};
|
|
110
|
-
/** Lock the deadbolt/door.
|
|
111
|
-
readonly lock: import("./members.js").MethodMember<() => Promise<void
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
/** Lock the deadbolt/door. Resolves after sending; does not confirm physical state. */
|
|
111
|
+
readonly lock: import("./members.js").MethodMember<() => Promise<void>> & {
|
|
112
|
+
available: (ctx: CommandContext) => boolean;
|
|
113
|
+
};
|
|
114
|
+
/** Unlock the deadbolt/door. Resolves after sending; does not confirm physical state. */
|
|
115
|
+
readonly unlock: import("./members.js").MethodMember<() => Promise<void>> & {
|
|
116
|
+
available: (ctx: CommandContext) => boolean;
|
|
117
|
+
};
|
|
114
118
|
/**
|
|
115
119
|
* Read-modify-write the auto-lock setting: the transport GETs the device's current settings, changes
|
|
116
120
|
* only `enabled` (+ `delaySeconds` if given — otherwise the current delay is preserved), and writes the
|
|
@@ -120,7 +124,9 @@ export declare const LOCK_MEMBERS: {
|
|
|
120
124
|
* **Unlike `lock`/`unlock` this can reject on a device TIMEOUT**, not just missing identity — the GET
|
|
121
125
|
* step is a genuine precondition, so this one is not fire-and-forget.
|
|
122
126
|
*/
|
|
123
|
-
readonly setAutoLock: import("./members.js").MethodMember<(enabled: boolean, delaySeconds?: number) => Promise<void
|
|
127
|
+
readonly setAutoLock: import("./members.js").MethodMember<(enabled: boolean, delaySeconds?: number) => Promise<void>> & {
|
|
128
|
+
available: (ctx: CommandContext) => boolean;
|
|
129
|
+
};
|
|
124
130
|
/**
|
|
125
131
|
* Toggle Rain Mode — a pure blind write, unlike `setAutoLock`: the compact frame carries only this one
|
|
126
132
|
* field, so there is no GET pass and it is fire-and-forget. Confirmed on-device end-to-end in both
|
|
@@ -220,6 +226,14 @@ export declare const LOCK_MEMBERS: {
|
|
|
220
226
|
readonly description: "One-touch rear locking (setting-id 11). Wire shape confirmed in the app's own JS, NOT captured.";
|
|
221
227
|
readonly write: (v: string | number | boolean, ctx: CommandContext) => Command;
|
|
222
228
|
};
|
|
229
|
+
/** Read the current device-reported state; undefined means no settled locked/unlocked state. */
|
|
230
|
+
readonly refreshStatus: {
|
|
231
|
+
readonly needs: "media";
|
|
232
|
+
readonly provided: (provider: MediaProvider, deps: import("./members.js").MemberDeps) => (() => Promise<boolean | undefined>) | undefined;
|
|
233
|
+
readonly description: string;
|
|
234
|
+
readonly requiredCapabilities?: readonly import("../types.js").Capability[];
|
|
235
|
+
readonly answers: true;
|
|
236
|
+
};
|
|
223
237
|
/**
|
|
224
238
|
* Read the device's current auto-lock settings via a live `GET_SETTINGS` round-trip — the SAME read
|
|
225
239
|
* `setAutoLock` does internally, exposed standalone with no write attached. Works over BOTH transports.
|
|
@@ -230,7 +244,7 @@ export declare const LOCK_MEMBERS: {
|
|
|
230
244
|
*/
|
|
231
245
|
readonly getAutoLockState: {
|
|
232
246
|
readonly needs: "ff09Settings";
|
|
233
|
-
readonly provided: (provider: import("../../core/contracts.js").Ff09SettingsReader, deps: import("./members.js").MemberDeps) => () => Promise<AutoLockSnapshot
|
|
247
|
+
readonly provided: (provider: import("../../core/contracts.js").Ff09SettingsReader, deps: import("./members.js").MemberDeps) => (() => Promise<AutoLockSnapshot>) | undefined;
|
|
234
248
|
readonly description: string;
|
|
235
249
|
readonly requiredCapabilities?: readonly import("../types.js").Capability[];
|
|
236
250
|
readonly answers: true;
|
|
@@ -60,6 +60,8 @@ export type ProductLine = "security" | "life" | "clean" | "print" | "display" |
|
|
|
60
60
|
* `p2p-frame` shape of {@link InboundSignal}.
|
|
61
61
|
*/
|
|
62
62
|
export interface CapabilityFrame {
|
|
63
|
+
/** Cloud device type resolved from the reporting station/channel. */
|
|
64
|
+
deviceType?: number;
|
|
63
65
|
stationSn: string;
|
|
64
66
|
commandId: number;
|
|
65
67
|
channel: number;
|
|
@@ -255,6 +257,8 @@ export interface AvailabilityContext {
|
|
|
255
257
|
stationDeviceType?: number;
|
|
256
258
|
}
|
|
257
259
|
export interface CommandContext extends AvailabilityContext {
|
|
260
|
+
/** Vendor-formatted timezone reported by the station; never inferred from the host. */
|
|
261
|
+
timezone?: string;
|
|
258
262
|
/** Device channel (0 for standalone, `device_channel` on a HomeBase). */
|
|
259
263
|
channel: number;
|
|
260
264
|
/** eufy DeviceType, when known. */
|
|
@@ -78,3 +78,5 @@ export declare const isAiotVacuum: (ctx: FamilyContext) => boolean;
|
|
|
78
78
|
* vacuums receive the same write actions as AIoT ones, routed by the facade's `routeCommand`.
|
|
79
79
|
*/
|
|
80
80
|
export declare const isTuyaVacuum: (ctx: FamilyContext) => boolean;
|
|
81
|
+
/** Video Smart Lock S330, identified by its distinct cloud device type. */
|
|
82
|
+
export declare const isVideoSmartLock: (ctx: FamilyContext) => boolean;
|
|
@@ -548,6 +548,7 @@ export declare class P2PCommandRouter {
|
|
|
548
548
|
*/
|
|
549
549
|
p2pQuery(sn: string, subCmd: number, opts?: {
|
|
550
550
|
timeoutMs?: number;
|
|
551
|
+
payload?: Record<string, unknown>;
|
|
551
552
|
}): Promise<Record<string, unknown>>;
|
|
552
553
|
/**
|
|
553
554
|
* **Generic control-payload request/reply query.** Sends a `CONTROL_PAYLOAD` (1700) `{commandType,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mega-yfue/eufy-sdk",
|
|
3
|
-
"version": "0.5.0-beta.
|
|
3
|
+
"version": "0.5.0-beta.71",
|
|
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",
|