@mega-yfue/eufy-sdk 0.0.4 → 0.1.0-beta.0
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/README.md +31 -12
- package/dist/client/device-registry.d.ts +343 -0
- package/dist/client/eufy-mega.d.ts +872 -0
- package/dist/client/index.d.ts +1 -6
- package/dist/client/map-channels.d.ts +22 -0
- package/dist/client/types.d.ts +383 -0
- package/dist/core/contracts.d.ts +898 -0
- package/dist/core/crypto.d.ts +98 -0
- package/dist/core/index.d.ts +9 -7
- package/dist/core/logger.d.ts +53 -0
- package/dist/core/lz4-block.d.ts +35 -0
- package/dist/core/raw-dp-hex.d.ts +32 -0
- package/dist/core/raw-dp-writer.d.ts +83 -0
- package/dist/core/store.d.ts +43 -0
- package/dist/core/types.d.ts +169 -0
- package/dist/core/util.d.ts +78 -0
- package/dist/index.d.ts +4 -7
- package/dist/index.js +25526 -14
- package/dist/index.js.map +7 -1
- package/dist/model/capabilities/access.d.ts +127 -0
- package/dist/model/capabilities/arming.d.ts +201 -0
- package/dist/model/capabilities/audio.d.ts +154 -0
- package/dist/model/capabilities/battery.d.ts +363 -0
- package/dist/model/capabilities/camera.d.ts +564 -0
- package/dist/model/capabilities/co.d.ts +40 -0
- package/dist/model/capabilities/contact.d.ts +133 -0
- package/dist/model/capabilities/doorbell.d.ts +345 -0
- package/dist/model/capabilities/dp-catalog.d.ts +38 -0
- package/dist/model/capabilities/index.d.ts +561 -0
- package/dist/model/capabilities/info.d.ts +28 -0
- package/dist/model/capabilities/keypad.d.ts +61 -0
- package/dist/model/capabilities/leak.d.ts +43 -0
- package/dist/model/capabilities/light.d.ts +174 -0
- package/dist/model/capabilities/locate.d.ts +63 -0
- package/dist/model/capabilities/lock.d.ts +242 -0
- package/dist/model/capabilities/manifest.d.ts +107 -0
- package/dist/model/capabilities/members.d.ts +647 -0
- package/dist/model/capabilities/motion.d.ts +377 -0
- package/dist/model/capabilities/person-detection.d.ts +8 -0
- package/dist/model/capabilities/ptz.d.ts +289 -0
- package/dist/model/capabilities/rtsp.d.ts +221 -0
- package/dist/model/capabilities/siren.d.ts +218 -0
- package/dist/model/capabilities/smart-light.d.ts +172 -0
- package/dist/model/capabilities/smoke.d.ts +40 -0
- package/dist/model/capabilities/snapshot.d.ts +6 -0
- package/dist/model/capabilities/storage.d.ts +11 -0
- package/dist/model/capabilities/suction.d.ts +104 -0
- package/dist/model/capabilities/types.d.ts +484 -0
- package/dist/model/capabilities/vacuum-clean.d.ts +1946 -0
- package/dist/model/capabilities/vacuum-dock.d.ts +208 -0
- package/dist/model/capabilities/video.d.ts +6 -0
- package/dist/model/classify.d.ts +78 -0
- package/dist/model/clean-record-detail.d.ts +65 -0
- package/dist/model/clean-records.d.ts +69 -0
- package/dist/model/device-family.d.ts +73 -0
- package/dist/model/device-types.d.ts +123 -0
- package/dist/model/device.d.ts +265 -0
- package/dist/model/index.d.ts +29 -4
- package/dist/model/infer.d.ts +23 -0
- package/dist/model/inspect.d.ts +61 -0
- package/dist/model/life-params.d.ts +21 -0
- package/dist/model/map-pixels.d.ts +70 -0
- package/dist/model/param-dictionary.d.ts +28 -0
- package/dist/model/param-namespace.d.ts +21 -0
- package/dist/model/proto-read.d.ts +53 -0
- package/dist/model/push-events.d.ts +147 -0
- package/dist/model/registry.d.ts +54 -0
- package/dist/model/types.d.ts +301 -0
- package/dist/model/vacuum-map-store.d.ts +92 -0
- package/dist/model/vacuum-map.d.ts +286 -0
- package/dist/model/vacuum-scenes.d.ts +76 -0
- package/dist/model/vacuum-schedules.d.ts +85 -0
- package/dist/transport/dp-preset.d.ts +102 -0
- package/dist/transport/ff09.d.ts +444 -0
- package/dist/transport/ffmpeg.d.ts +86 -0
- package/dist/transport/http/decodeImageV1.d.ts +20 -0
- package/dist/transport/http/decodeImageV2.d.ts +19 -0
- package/dist/transport/http/index.d.ts +5 -0
- package/dist/transport/http/light-catalog.d.ts +62 -0
- package/dist/transport/http/media-download.d.ts +14 -0
- package/dist/transport/http/mega-client.d.ts +514 -0
- package/dist/transport/http/phone-model.d.ts +21 -0
- package/dist/transport/index.d.ts +10 -7
- package/dist/transport/mqtt/app-client-id.d.ts +16 -0
- package/dist/transport/mqtt/availability.d.ts +14 -0
- package/dist/transport/mqtt/bare-ip-tls.d.ts +46 -0
- package/dist/transport/mqtt/biz-stream.d.ts +98 -0
- package/dist/transport/mqtt/broker-discovery.d.ts +55 -0
- package/dist/transport/mqtt/clean-codec.d.ts +14 -0
- package/dist/transport/mqtt/command-router.d.ts +285 -0
- package/dist/transport/mqtt/dp-codec.d.ts +58 -0
- package/dist/transport/mqtt/dp-color.d.ts +14 -0
- package/dist/transport/mqtt/engine.d.ts +16 -0
- package/dist/transport/mqtt/index.d.ts +5 -0
- package/dist/transport/mqtt/secure-mqtt.d.ts +107 -0
- package/dist/transport/mqtt/topics.d.ts +80 -0
- package/dist/transport/p2p/adts.d.ts +91 -0
- package/dist/transport/p2p/annexb.d.ts +124 -0
- package/dist/transport/p2p/codec.d.ts +166 -0
- package/dist/transport/p2p/command-router.d.ts +655 -0
- package/dist/transport/p2p/commands.d.ts +550 -0
- package/dist/transport/p2p/envelope.d.ts +46 -0
- package/dist/transport/p2p/fmp4.d.ts +89 -0
- package/dist/transport/p2p/fragment-recording.d.ts +33 -0
- package/dist/transport/p2p/index.d.ts +13 -0
- package/dist/transport/p2p/lan-ip.d.ts +25 -0
- package/dist/transport/p2p/live-stream.d.ts +223 -0
- package/dist/transport/p2p/live-trace.d.ts +123 -0
- package/dist/transport/p2p/media.d.ts +105 -0
- package/dist/transport/p2p/p2p-session.d.ts +620 -0
- package/dist/transport/p2p/readable-egress.d.ts +27 -0
- package/dist/transport/p2p/session-manager.d.ts +154 -0
- package/dist/transport/p2p/shared-live-source.d.ts +431 -0
- package/dist/transport/p2p/talkback.d.ts +187 -0
- package/dist/transport/p2p/video.d.ts +150 -0
- package/dist/transport/p2p/write-commands.d.ts +21 -0
- package/dist/transport/protobuf.d.ts +5 -0
- package/dist/transport/push/fcm.d.ts +23 -0
- package/dist/transport/push/index.d.ts +6 -0
- package/dist/transport/push/message-tags.d.ts +26 -0
- package/dist/transport/push/parser.d.ts +27 -0
- package/dist/transport/push/proto.d.ts +11 -0
- package/dist/transport/push/push-client.d.ts +64 -0
- package/dist/transport/push/store.d.ts +23 -0
- package/dist/transport/push/types.d.ts +180 -0
- package/dist/transport/raw-dp.d.ts +6 -0
- package/dist/transport/stored-image-cache.d.ts +23 -0
- package/dist/transport/tuya/account.d.ts +44 -0
- package/dist/transport/tuya/client.d.ts +89 -0
- package/dist/transport/tuya/command-router.d.ts +79 -0
- package/dist/transport/tuya/dp-codec.d.ts +56 -0
- package/dist/transport/tuya/index.d.ts +28 -0
- package/dist/transport/tuya/request.d.ts +157 -0
- package/dist/transport/tuya/sign.d.ts +64 -0
- package/package.json +12 -13
- package/dist/client/index.js +0 -2
- package/dist/client/index.js.map +0 -1
- package/dist/core/index.js +0 -2
- package/dist/core/index.js.map +0 -1
- package/dist/model/index.js +0 -2
- package/dist/model/index.js.map +0 -1
- package/dist/transport/index.js +0 -2
- package/dist/transport/index.js.map +0 -1
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import type { AvailabilityContext, CapabilityModule, CommandContext } from "./types.js";
|
|
2
|
+
import { type Surface } from "./members.js";
|
|
3
|
+
import type { Command } from "../../core/contracts.js";
|
|
4
|
+
/**
|
|
5
|
+
* The P2P **param-type ids** this battery/power capability reads and writes — the `param_type` a device
|
|
6
|
+
* self-reports in `get_devs_list` / the `GET_CAMERA_INFO` (1103) live param list. Capability-owned wire
|
|
7
|
+
* vocabulary (a curated subset; the full id→name catalog + schema live in `../param-dictionary.ts`).
|
|
8
|
+
* Distinct from a feature-COMMAND id (the write outer-command) — these are STATE/settings param ids.
|
|
9
|
+
*/
|
|
10
|
+
export declare const BATTERY_PARAM: {
|
|
11
|
+
/** Battery level 0-100 (app `BATTERY_VALUE`). */
|
|
12
|
+
readonly BATTERY: 1101;
|
|
13
|
+
/**
|
|
14
|
+
* Battery/charge **status bitfield** (app `BATTERY_STATUS`). The app decodes it, not shown raw:
|
|
15
|
+
* `charging = value ∉ {0,2}`; solar-panel-connected when `value ∈ {4,5,12,20}`. Drives the battery
|
|
16
|
+
* `charging` property.
|
|
17
|
+
*/
|
|
18
|
+
readonly BATTERY_STATUS: 2111;
|
|
19
|
+
/** Battery temperature °C (app `GET_BATTERY_TEMP`). */
|
|
20
|
+
readonly BATTERY_TEMP: 1138;
|
|
21
|
+
/** Battery health 0-100 (app `APP_CMD_DEV_BATTERY_HEALTHY_V2`). */
|
|
22
|
+
readonly BATTERY_HEALTH: 1198;
|
|
23
|
+
/** Charging-in-progress flag (app `APP_CMD_SET_POWER_CHARGE`). */
|
|
24
|
+
readonly POWER_CHARGE: 1293;
|
|
25
|
+
/** Power **working mode** enum, e.g. optimal-battery / optimal-surveillance / custom (app `SET_INDOOR_POWER_MODE`). */
|
|
26
|
+
readonly WORKING_MODE: 1246;
|
|
27
|
+
/** Clip length in seconds (app `SET_RECORD_DURATION`). */
|
|
28
|
+
readonly RECORD_DURATION: 1249;
|
|
29
|
+
/** Minimum interval between clips, seconds (app `SET_RECORD_INTERVAL`). */
|
|
30
|
+
readonly RECORD_INTERVAL: 1250;
|
|
31
|
+
/** End-clip-early toggle — stop recording when motion ends (app `SET_RECORD_AUTO_STOP`). INVERTED: raw 0 = ON. */
|
|
32
|
+
readonly RECORD_AUTO_STOP: 1251;
|
|
33
|
+
/** Solar-panel light/charge intensity; 0 = none (app `APP_CMD_SOLAR_INTENSITY`). */
|
|
34
|
+
readonly SOLAR_INTENSITY: 1309;
|
|
35
|
+
/** Whether a solar panel supplied power in the last 24h (app `APP_CMD_GET_SOLAR_PANEL_CONNECT_24H`). */
|
|
36
|
+
readonly SOLAR_CONNECT_24H: 6482;
|
|
37
|
+
/** Battery power-history stats JSON (app `APP_CMD_GET_BATTERY_POWER_DATAS`). Often P2P-dump-only. */
|
|
38
|
+
readonly BATTERY_POWER_DATAS: 3100;
|
|
39
|
+
/**
|
|
40
|
+
* `GET_CAMERA_INFO` — reported by battery cameras, meaning NOT evidenced. Read live as the constant
|
|
41
|
+
* `5` on a T8170 at 92% and a T8171 at 27%, so nothing about it tracks the battery. See
|
|
42
|
+
* `BATTERY_MEMBERS`'s `cameraInfo`.
|
|
43
|
+
*/
|
|
44
|
+
readonly CAMERA_INFO: 1103;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* `battery` — battery level, charging state, health, temperature, solar input, and the power settings
|
|
48
|
+
* that decide how hard the device works: the working mode, plus the three `record*` members that tune
|
|
49
|
+
* its Customize-Recording mode (how long a recording runs, how soon the next may start, whether it stops
|
|
50
|
+
* early when motion ends).
|
|
51
|
+
*
|
|
52
|
+
* Every param is a confirmed app-enum id read live off the fleet. `charging` is derived from the
|
|
53
|
+
* `BATTERY_STATUS` (2111) bitfield the way the app itself decodes it (`value ∉ {0,2}`).
|
|
54
|
+
* `batteryPowerStats` (3100) is only in the P2P param dump on some devices — read it via the live P2P
|
|
55
|
+
* param query (the owner-gated cloud call can't return it).
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* The working modes the app offers (names shared across models). Use `WorkingMode.CustomizeRecording`
|
|
59
|
+
* etc. with `setWorkingMode` / `setProperty` — each is resolved to that model's raw index via
|
|
60
|
+
* {@link WORKING_MODE_MAPS} (models number them differently; a mode a model lacks is a safe no-op).
|
|
61
|
+
*/
|
|
62
|
+
export declare const WorkingMode: {
|
|
63
|
+
readonly OptimalBatteryLife: "Optimal Battery Life";
|
|
64
|
+
readonly OptimalSurveillance: "Optimal Surveillance";
|
|
65
|
+
readonly CustomizeRecording: "Customize Recording";
|
|
66
|
+
readonly BalanceSurveillance: "Balance Surveillance";
|
|
67
|
+
};
|
|
68
|
+
/** A working-mode name — the value side of {@link WorkingMode}. */
|
|
69
|
+
export type WorkingModeName = (typeof WorkingMode)[keyof typeof WorkingMode];
|
|
70
|
+
/** Power source options — pass `PowerSource.Battery` / `PowerSource.ExternalSolarPanel` to `setPowerSource`. */
|
|
71
|
+
export declare const PowerSource: {
|
|
72
|
+
readonly Battery: "battery";
|
|
73
|
+
readonly ExternalSolarPanel: "external";
|
|
74
|
+
};
|
|
75
|
+
/** A power-source name — the value side of {@link PowerSource}. */
|
|
76
|
+
export type PowerSourceName = (typeof PowerSource)[keyof typeof PowerSource];
|
|
77
|
+
/**
|
|
78
|
+
* Bound battery/power state and controls — the object returned by `dev.battery()`.
|
|
79
|
+
*
|
|
80
|
+
* Every getter, setter, argument type and description is DERIVED from `BATTERY_MEMBERS`; there is
|
|
81
|
+
* nothing this capability does that the table cannot state, so nothing is written out here. All writes
|
|
82
|
+
* are fire-and-forget; confirm a change by re-reading.
|
|
83
|
+
*/
|
|
84
|
+
export type BatteryActions = Surface<typeof BATTERY_MEMBERS>;
|
|
85
|
+
/**
|
|
86
|
+
* Reinterpret the reported power source (1293), whose wire form VARIES BY MODEL: a plain int on some
|
|
87
|
+
* (T8124R), a JSON string `{"power_source":N}` on others. Both reduce to the numeric N; a value that is
|
|
88
|
+
* neither is passed through as-is rather than turned into a plausible number.
|
|
89
|
+
*
|
|
90
|
+
* The richer raw `APP_CMD_SET_POWER_SOURCE` blob is a separate param, surfaced as `powerSourceInfo`.
|
|
91
|
+
*/
|
|
92
|
+
declare function decodePowerSource(raw: string | number | boolean): number | string;
|
|
93
|
+
/** False for a mains camera that only reports 1101 as a sentinel — used to gate the physical reads. */
|
|
94
|
+
declare const notMainsCamera: (ctx: AvailabilityContext) => boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Every `battery` feature, declared once — the property schema, the evidence-gated getters, the derived
|
|
97
|
+
* setters, the intent routes and the descriptions all come out of this table. Order is schema order.
|
|
98
|
+
*
|
|
99
|
+
* Each write is gated on the device reporting the param it reads back, because "has a battery" is much
|
|
100
|
+
* weaker evidence than "speaks this setting": an entry sensor reports a level (1101) and nothing else,
|
|
101
|
+
* and handing it a power-source frame it never accepts would look like success.
|
|
102
|
+
*
|
|
103
|
+
* Exported but NOT published: each entry states its wire id and the evidence it was confirmed on,
|
|
104
|
+
* which the reference site does not carry.
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
export declare const BATTERY_MEMBERS: {
|
|
108
|
+
/**
|
|
109
|
+
* The headline percentage, and this capability's detection evidence: reporting 1101 is what proves a
|
|
110
|
+
* device is battery-powered, which is also the fact `MediaProvider` reads to decide a stream needs a
|
|
111
|
+
* power budget. Published flat as `battery` — `level` alone is claimed by `suction` too.
|
|
112
|
+
*/
|
|
113
|
+
readonly level: {
|
|
114
|
+
readonly param: 1101;
|
|
115
|
+
readonly property: "battery";
|
|
116
|
+
readonly type: "number";
|
|
117
|
+
readonly unit: "%";
|
|
118
|
+
readonly kind: "percent";
|
|
119
|
+
readonly provenance: "verified";
|
|
120
|
+
readonly available: typeof notMainsCamera;
|
|
121
|
+
readonly description: "Battery level 0-100 (verified: param 1101).";
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Derived from `BATTERY_STATUS` (2111), NOT `powerCharge` (1293): the app decodes it as
|
|
125
|
+
* `charging = value ∉ {0,2}` (Hermes `device_charging_mode` parser). That catches solar
|
|
126
|
+
* trickle-charge which 1293 misses — a T8124 with a built-in solar panel reads 4 = charging.
|
|
127
|
+
*/
|
|
128
|
+
readonly charging: {
|
|
129
|
+
readonly param: 2111;
|
|
130
|
+
readonly type: "bool";
|
|
131
|
+
readonly kind: "boolean";
|
|
132
|
+
readonly provenance: "apk";
|
|
133
|
+
readonly available: typeof notMainsCamera;
|
|
134
|
+
readonly coerce: (v: string | number | boolean) => boolean;
|
|
135
|
+
readonly description: string;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* 1293 is the READABLE indicator (6445 is write-only/cloud-hidden). Verified live on a T8124R via an
|
|
139
|
+
* app-toggle before/after diff: 0 = Battery, 1 = External Solar Panel. Values beyond 0/1 (some models
|
|
140
|
+
* report 5) are shown raw — `enumValues` only labels the two that are confirmed.
|
|
141
|
+
*
|
|
142
|
+
* The write is a `1350` SET_PAYLOAD, inner cmd 1293, `{charge_mode:N}`, `mValue3` 0 (the app uses 0,
|
|
143
|
+
* not the cmd id), and the setter accepts a NAME as well as the index the getter answers.
|
|
144
|
+
*/
|
|
145
|
+
readonly powerSource: {
|
|
146
|
+
readonly accepts: PowerSourceName;
|
|
147
|
+
readonly param: 1293;
|
|
148
|
+
readonly type: "enum";
|
|
149
|
+
readonly kind: "enum";
|
|
150
|
+
readonly enumValues: {
|
|
151
|
+
readonly 0: "Battery";
|
|
152
|
+
readonly 1: "External Solar Panel";
|
|
153
|
+
};
|
|
154
|
+
readonly provenance: "verified";
|
|
155
|
+
readonly coerce: typeof decodePowerSource;
|
|
156
|
+
readonly requires: readonly [1293];
|
|
157
|
+
readonly args: readonly [{
|
|
158
|
+
readonly name: "source";
|
|
159
|
+
readonly kind: "enum";
|
|
160
|
+
readonly description: "The raw value, or the name `battery`/`external`.";
|
|
161
|
+
}];
|
|
162
|
+
readonly description: string;
|
|
163
|
+
readonly write: (v: string | number | boolean, ctx: CommandContext) => Command;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* A DEVICE-SPECIFIC mode index: the app maps value→mode through a per-model config (Hermes
|
|
167
|
+
* `doValueConvertToUIIndex` + a per-device `mappingConfigObject`), NOT a universal enum. The domain
|
|
168
|
+
* is resolved per device by {@link publishedWorkingModeDomain}: a confirmed model publishes its
|
|
169
|
+
* {index → label} set (the 3-mode identity map for battery cameras, the 4-mode map for the T8214
|
|
170
|
+
* doorbell), and a model with no confirmed set publishes none. Name a value with {@link
|
|
171
|
+
* resolveWorkingMode}.
|
|
172
|
+
*
|
|
173
|
+
* The static `kind` stays `"scalar"`: a member with no static `enumValues` cannot declare `kind:
|
|
174
|
+
* "enum"` (the value-kinds guard). `enumValuesFor` supplies the per-device domain, and the resolver
|
|
175
|
+
* stamps the RESOLVED spec/read as an enum so the published surface is self-consistent.
|
|
176
|
+
*
|
|
177
|
+
* The write is DIRECT-BINARY, outer-cmd 1246, `[channel][value=mode][account_id]`. A mode NAME the
|
|
178
|
+
* model does not offer resolves to nothing, which is what makes the setter refuse rather than send a
|
|
179
|
+
* wrong index.
|
|
180
|
+
*/
|
|
181
|
+
readonly workingMode: {
|
|
182
|
+
readonly accepts: WorkingModeName;
|
|
183
|
+
readonly param: 1246;
|
|
184
|
+
readonly type: "number";
|
|
185
|
+
readonly kind: "scalar";
|
|
186
|
+
readonly enumValuesFor: typeof publishedWorkingModeDomain;
|
|
187
|
+
readonly provenance: "verified";
|
|
188
|
+
readonly requires: readonly [1246];
|
|
189
|
+
readonly min: 0;
|
|
190
|
+
readonly args: readonly [{
|
|
191
|
+
readonly name: "mode";
|
|
192
|
+
readonly kind: "scalar";
|
|
193
|
+
readonly min: 0;
|
|
194
|
+
readonly description: "A mode index, or its name. The set is per-model — name one with resolveWorkingMode.";
|
|
195
|
+
}];
|
|
196
|
+
readonly description: string;
|
|
197
|
+
readonly write: (v: string | number | boolean, ctx: CommandContext) => Command | undefined;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* One of the three Customize-Recording settings, and the pair to `recordInterval`: this bounds how
|
|
201
|
+
* long a clip runs, that bounds how soon the next may begin. Writing it on a device in another
|
|
202
|
+
* working mode changes the stored setting but nothing observable, so set `workingMode` first. Gated
|
|
203
|
+
* on the device reporting 1249, since "has a battery" does not mean "speaks this setting".
|
|
204
|
+
*/
|
|
205
|
+
readonly recordDuration: {
|
|
206
|
+
readonly param: 1249;
|
|
207
|
+
readonly type: "number";
|
|
208
|
+
readonly unit: "s";
|
|
209
|
+
readonly kind: "seconds";
|
|
210
|
+
readonly provenance: "verified";
|
|
211
|
+
readonly requires: readonly [1249];
|
|
212
|
+
readonly min: 0;
|
|
213
|
+
readonly description: string;
|
|
214
|
+
readonly write: (v: string | number | boolean, ctx: CommandContext) => Command;
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* The motion re-arm gap: seconds of enforced quiet after a clip ends before another may start, so it
|
|
218
|
+
* is the setting that decides how much a busy scene costs the battery. Same Customize-Recording
|
|
219
|
+
* scope and same per-param gate as `recordDuration`; the two are usually tuned together.
|
|
220
|
+
*/
|
|
221
|
+
readonly recordInterval: {
|
|
222
|
+
readonly param: 1250;
|
|
223
|
+
readonly type: "number";
|
|
224
|
+
readonly unit: "s";
|
|
225
|
+
readonly kind: "seconds";
|
|
226
|
+
readonly provenance: "verified";
|
|
227
|
+
readonly requires: readonly [1250];
|
|
228
|
+
readonly min: 0;
|
|
229
|
+
readonly description: string;
|
|
230
|
+
readonly write: (v: string | number | boolean, ctx: CommandContext) => Command;
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* INVERTED on the wire (a disable flag): the app decodes `stop-early = (value === 0)` (Hermes
|
|
234
|
+
* `motion_stop_end_early = asBooleanToIntString("0" === value)`), so raw 0 means the feature is ON.
|
|
235
|
+
*/
|
|
236
|
+
readonly recordAutoStop: {
|
|
237
|
+
readonly param: 1251;
|
|
238
|
+
readonly type: "bool";
|
|
239
|
+
readonly kind: "boolean";
|
|
240
|
+
readonly provenance: "verified";
|
|
241
|
+
readonly requires: readonly [1251];
|
|
242
|
+
readonly invert: true;
|
|
243
|
+
readonly description: string;
|
|
244
|
+
readonly write: (v: string | number | boolean, ctx: CommandContext) => Command;
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* The cell temperature the device measures, in its own degrees Celsius — never converted, since
|
|
248
|
+
* rescaling a number sourced only from the app's param table would be inventing precision. Read-only:
|
|
249
|
+
* `apk` provenance means the id comes from the disassembled app, not from a captured toggle, so
|
|
250
|
+
* nothing here establishes a write. Pairs with the `batteryAlert` HOT push.
|
|
251
|
+
*/
|
|
252
|
+
readonly temperature: {
|
|
253
|
+
readonly param: 1138;
|
|
254
|
+
readonly property: "batteryTemperature";
|
|
255
|
+
readonly type: "number";
|
|
256
|
+
readonly unit: "°C";
|
|
257
|
+
readonly kind: "celsius";
|
|
258
|
+
readonly provenance: "apk";
|
|
259
|
+
readonly description: "Battery temperature (1138 GET_BATTERY_TEMP).";
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Remaining cell capacity as a percentage of new — a slow-moving ageing figure, NOT the current
|
|
263
|
+
* charge (`level` is that), which is why it takes its own flat name `batteryHealth`. `apk`
|
|
264
|
+
* provenance: the id is read out of the disassembled app rather than from a captured change.
|
|
265
|
+
*/
|
|
266
|
+
readonly health: {
|
|
267
|
+
readonly param: 1198;
|
|
268
|
+
readonly property: "batteryHealth";
|
|
269
|
+
readonly type: "number";
|
|
270
|
+
readonly unit: "%";
|
|
271
|
+
readonly kind: "percent";
|
|
272
|
+
readonly provenance: "apk";
|
|
273
|
+
readonly description: "Battery health 0-100 (1198 APP_CMD_DEV_BATTERY_HEALTHY_V2).";
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* How much light the solar panel is currently harvesting. A bare `scalar` on purpose: only the zero
|
|
277
|
+
* point is established (0 = no solar input), so the SDK declares no unit and no ceiling rather than
|
|
278
|
+
* publishing a percentage the wire has not been shown to be. `apk` provenance.
|
|
279
|
+
*/
|
|
280
|
+
readonly solarIntensity: {
|
|
281
|
+
readonly param: 1309;
|
|
282
|
+
readonly type: "number";
|
|
283
|
+
readonly kind: "scalar";
|
|
284
|
+
readonly provenance: "apk";
|
|
285
|
+
readonly description: "Solar-panel light/charge intensity (1309 APP_CMD_SOLAR_INTENSITY); 0 = no solar input.";
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* A rolling 24-hour verdict on whether the panel contributed anything — so it stays true through a
|
|
289
|
+
* night, and is the right read for "is the panel actually working", where `solarIntensity` only says
|
|
290
|
+
* what it is doing this instant. `apk` provenance; the id is the app's own, not a captured toggle.
|
|
291
|
+
*/
|
|
292
|
+
readonly solarConnected24h: {
|
|
293
|
+
readonly param: 6482;
|
|
294
|
+
readonly type: "bool";
|
|
295
|
+
readonly kind: "boolean";
|
|
296
|
+
readonly provenance: "apk";
|
|
297
|
+
readonly description: "Whether a solar panel supplied power in the last 24h (6482 APP_CMD_GET_SOLAR_PANEL_CONNECT_24H).";
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Reported, so it stays in the schema and answers through `getProperty` — but given no typed getter:
|
|
301
|
+
* the payload's fields have never been decoded, and a getter would hand back an opaque blob typed as
|
|
302
|
+
* though it meant something.
|
|
303
|
+
*/
|
|
304
|
+
readonly batteryPowerStats: {
|
|
305
|
+
readonly param: 3100;
|
|
306
|
+
readonly type: "string";
|
|
307
|
+
readonly kind: "text";
|
|
308
|
+
readonly provenance: "apk";
|
|
309
|
+
readonly unexposed: true;
|
|
310
|
+
readonly description: string;
|
|
311
|
+
};
|
|
312
|
+
/**
|
|
313
|
+
* `GET_CAMERA_INFO` (1103), reported by battery cameras with its meaning unevidenced — so it is in the
|
|
314
|
+
* schema and reachable through `getProperty`, with no typed getter.
|
|
315
|
+
*
|
|
316
|
+
* It is NOT a low-battery flag, on two independent grounds: the app's own param table names 1103
|
|
317
|
+
* `GET_CAMERA_INFO`, and a T8170 at 92% and a T8171 at 27% both report the constant `5`. Typed as a
|
|
318
|
+
* bool it would read `false` on every device forever — a shape indistinguishable from a real answer.
|
|
319
|
+
*/
|
|
320
|
+
readonly cameraInfo: {
|
|
321
|
+
readonly param: 1103;
|
|
322
|
+
readonly type: "number";
|
|
323
|
+
readonly kind: "scalar";
|
|
324
|
+
readonly provenance: "apk";
|
|
325
|
+
readonly unexposed: true;
|
|
326
|
+
readonly description: string;
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
export declare const BATTERY: CapabilityModule;
|
|
330
|
+
/**
|
|
331
|
+
* Working-mode value → label maps, keyed by device model T-code. Models number the same mode
|
|
332
|
+
* differently and the mapping is per-device, so the maps are kept here and resolved by model.
|
|
333
|
+
* **Expand as new models are confirmed** — most battery cameras use the 3-mode identity map
|
|
334
|
+
* (`DEFAULT`); a model with a different set (e.g. a doorbell's extra "Balance Surveillance") gets its
|
|
335
|
+
* own entry, matched by model T-code prefix.
|
|
336
|
+
*/
|
|
337
|
+
export declare const WORKING_MODE_MAPS: Readonly<Record<string, Readonly<Record<number, string>>>>;
|
|
338
|
+
/**
|
|
339
|
+
* Resolve a `workingMode` raw value to its human mode label for a device model — or `undefined`
|
|
340
|
+
* if the value isn't in that model's map. Matches the model against the {@link WORKING_MODE_MAPS} keys
|
|
341
|
+
* by T-code prefix, falling back to the 3-mode camera `DEFAULT`.
|
|
342
|
+
*/
|
|
343
|
+
export declare function resolveWorkingMode(model: string | undefined, value: number): string | undefined;
|
|
344
|
+
/**
|
|
345
|
+
* Return the working-mode {index → label} map for a device model — its own {@link WORKING_MODE_MAPS}
|
|
346
|
+
* entry when one matches by T-code prefix, otherwise the 3-mode `DEFAULT`. Always returns a map (used
|
|
347
|
+
* for name↔index resolution), unlike {@link publishedWorkingModeDomain} which may return `undefined`.
|
|
348
|
+
*/
|
|
349
|
+
export declare function workingModeMap(model: string | undefined): Readonly<Record<number, string>>;
|
|
350
|
+
/**
|
|
351
|
+
* Return the working-mode {index → label} domain to publish for a device, or `undefined` when the
|
|
352
|
+
* device has no confirmed domain. Returns a model's own {@link WORKING_MODE_MAPS} entry when one
|
|
353
|
+
* matches by T-code prefix, else the 3-mode `DEFAULT` for a {@link WORKING_MODE_DEFAULT_MODELS} model,
|
|
354
|
+
* else `undefined` — so a camera that merely reports the param without a confirmed set (e.g. the mains
|
|
355
|
+
* Indoor Cam T8419) publishes no domain rather than an unverified one.
|
|
356
|
+
*/
|
|
357
|
+
declare function publishedWorkingModeDomain(ctx: AvailabilityContext): Readonly<Record<number, string>> | undefined;
|
|
358
|
+
/**
|
|
359
|
+
* Inverse of {@link resolveWorkingMode}: the raw index for a mode NAME on a device model — or
|
|
360
|
+
* `undefined` if that model doesn't offer the named mode. Used to let `setWorkingMode` take names.
|
|
361
|
+
*/
|
|
362
|
+
export declare function resolveWorkingModeValue(model: string | undefined, name: string): number | undefined;
|
|
363
|
+
export {};
|