@mega-yfue/eufy-sdk 0.3.0-beta.8 → 0.3.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.
|
@@ -674,7 +674,8 @@ export declare class EufyMega extends EventEmitter {
|
|
|
674
674
|
private warmWiredP2P;
|
|
675
675
|
/**
|
|
676
676
|
* A station's power tier for the P2P lifecycle: a HomeBase/station is `"wired"` (persistent); a
|
|
677
|
-
* standalone device is `"battery"` iff its resolved capabilities include `battery
|
|
677
|
+
* standalone device is `"battery"` iff its resolved capabilities include `battery` and it is not a
|
|
678
|
+
* confirmed mains-only camera model, else `"wired"`.
|
|
678
679
|
* Keyed on the STATION's own power, never a child's (a battery cam attached to a wired HomeBase draws
|
|
679
680
|
* from the base's persistent session). Reads capabilities on the client side — no model type leaks to
|
|
680
681
|
* transport (the router only ever sees the `"wired"|"battery"` string).
|
package/dist/index.js
CHANGED
|
@@ -4326,7 +4326,10 @@ function decodePowerSource(raw) {
|
|
|
4326
4326
|
function recordSetting(param, value, ctx) {
|
|
4327
4327
|
return setStationScalar(param, value, ctx.channel);
|
|
4328
4328
|
}
|
|
4329
|
-
var MAINS_CAMERA_MODELS = ["T8425", "T8419", "T8410"];
|
|
4329
|
+
var MAINS_CAMERA_MODELS = ["T8425", "T8419", "T8410", "T84A1"];
|
|
4330
|
+
function cameraPowerTier(model, capabilities) {
|
|
4331
|
+
return capabilities.has("battery") && notMainsCamera({ model }) ? "battery" : "wired";
|
|
4332
|
+
}
|
|
4330
4333
|
var notMainsCamera = (ctx) => {
|
|
4331
4334
|
const model = (ctx.model ?? "").toUpperCase();
|
|
4332
4335
|
return !MAINS_CAMERA_MODELS.some((prefix) => model.startsWith(prefix));
|
|
@@ -5236,7 +5239,7 @@ function statusLedCommand(on, ctx) {
|
|
|
5236
5239
|
return setScalar(CAMERA_CMD.DEV_LED_SWITCH, on ? 1 : 0, ctx, "int-string");
|
|
5237
5240
|
}
|
|
5238
5241
|
function poweredOf(ctx) {
|
|
5239
|
-
return ctx.capabilities
|
|
5242
|
+
return cameraPowerTier(ctx.model, ctx.capabilities ?? /* @__PURE__ */ new Set());
|
|
5240
5243
|
}
|
|
5241
5244
|
function enablementReflection(on, ctx) {
|
|
5242
5245
|
const alias = CAMERA_MEMBERS.enabled.readAliases[0].paramType;
|
|
@@ -10886,6 +10889,8 @@ var MODEL_REGISTRY = {
|
|
|
10886
10889
|
T8400: { codec: "camera", caps: ["arming"], name: "Indoor Cam" },
|
|
10887
10890
|
T8410: { codec: "camera", caps: ["arming"], name: "Indoor Cam Pan & Tilt" },
|
|
10888
10891
|
T8442: { codec: "camera", caps: ["arming"], name: "Indoor/Outdoor Cam 1080p" },
|
|
10892
|
+
// Hardwired wall-light camera; mains power asserted in MAINS_CAMERA_MODELS.
|
|
10893
|
+
T84A1: { codec: "camera", name: "Wall Light Cam S100" },
|
|
10889
10894
|
// Sensors — the concrete sensor kind is curated (DeviceType 2 alone is ambiguous).
|
|
10890
10895
|
T8900: { codec: "sensor", caps: ["contact"], name: "Entry Sensor" },
|
|
10891
10896
|
T8910: { codec: "sensor", caps: ["battery"], name: "Motion Sensor" },
|
|
@@ -26384,7 +26389,8 @@ var EufyMega = class extends EventEmitter9 {
|
|
|
26384
26389
|
}
|
|
26385
26390
|
/**
|
|
26386
26391
|
* A station's power tier for the P2P lifecycle: a HomeBase/station is `"wired"` (persistent); a
|
|
26387
|
-
* standalone device is `"battery"` iff its resolved capabilities include `battery
|
|
26392
|
+
* standalone device is `"battery"` iff its resolved capabilities include `battery` and it is not a
|
|
26393
|
+
* confirmed mains-only camera model, else `"wired"`.
|
|
26388
26394
|
* Keyed on the STATION's own power, never a child's (a battery cam attached to a wired HomeBase draws
|
|
26389
26395
|
* from the base's persistent session). Reads capabilities on the client side — no model type leaks to
|
|
26390
26396
|
* transport (the router only ever sees the `"wired"|"battery"` string).
|
|
@@ -26402,7 +26408,7 @@ var EufyMega = class extends EventEmitter9 {
|
|
|
26402
26408
|
category: d.category,
|
|
26403
26409
|
params: d.params ?? {}
|
|
26404
26410
|
}).capabilities;
|
|
26405
|
-
return
|
|
26411
|
+
return cameraPowerTier(d.model, new Set(caps));
|
|
26406
26412
|
}
|
|
26407
26413
|
/**
|
|
26408
26414
|
* Speculatively open the P2P session of the station behind `deviceSn`, if the caller opted this
|