@mega-yfue/eufy-sdk 0.5.0-beta.85 → 0.5.0-beta.86
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/index.js +17 -2
- package/dist/index.js.map +2 -2
- package/dist/model/capabilities/camera.d.ts +14 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5347,6 +5347,8 @@ var CAMERA_CMD = {
|
|
|
5347
5347
|
* (1013). (Some models omit full colour; enum in {@link NightVision}.)
|
|
5348
5348
|
*/
|
|
5349
5349
|
NIGHT_VISION_TYPE: 1277,
|
|
5350
|
+
/** T8442 infrared night vision on/off: direct L1 int-string, hardware verified (0/1). */
|
|
5351
|
+
IC_NIGHT_VISION_TYPE: 1013,
|
|
5350
5352
|
/**
|
|
5351
5353
|
* Push-notification STYLE — how much a detection push carries: text alone, a thumbnail, or text
|
|
5352
5354
|
* followed by a thumbnail. App `CMD_INDOOR_PUSH_NOTIFY_TYPE`, and the "indoor" is a misnomer: the
|
|
@@ -5537,6 +5539,9 @@ function powerValue(on, ctx) {
|
|
|
5537
5539
|
function isT8410HomeBase3(ctx) {
|
|
5538
5540
|
return ctx.model === "T8410" && ctx.stationSerial?.startsWith("T8030") === true;
|
|
5539
5541
|
}
|
|
5542
|
+
function isT8442(ctx) {
|
|
5543
|
+
return ctx.model === "T8442";
|
|
5544
|
+
}
|
|
5540
5545
|
function usesHomeBasePowerPayload(ctx) {
|
|
5541
5546
|
if (!isT8410HomeBase3(ctx) || !ctx.firmwareVersion || !/^\d+(?:\.\d+){2,3}$/.test(ctx.firmwareVersion))
|
|
5542
5547
|
return false;
|
|
@@ -5758,12 +5763,22 @@ var CAMERA_MEMBERS = {
|
|
|
5758
5763
|
type: "enum",
|
|
5759
5764
|
kind: "enum",
|
|
5760
5765
|
enumValues: { 0: "Off", 1: "Infrared", 2: "Full Color" },
|
|
5766
|
+
enumValuesFor: (ctx) => isT8442(ctx) ? { 0: "Off", 1: "Infrared" } : void 0,
|
|
5761
5767
|
provenance: "verified",
|
|
5762
5768
|
available: isCameraCodec,
|
|
5763
|
-
|
|
5769
|
+
readAvailable: (ctx) => !isT8442(ctx),
|
|
5770
|
+
readAliases: [{ paramType: 2002, available: isT8442 }],
|
|
5771
|
+
description: "Night-vision mode: 0 = off, 1 = infrared (B&W), 2 = full colour where supported. T8425 uses NIGHT_VISION_TYPE 1277 (1350 SET_PAYLOAD, night_sion); T8442 reports 2002 and writes direct IC_NIGHT_VISION_TYPE 1013 (int-string, 0/1). Both wires verified live.",
|
|
5764
5772
|
write: (v, ctx) => {
|
|
5765
5773
|
const nv = coerceEnumValue(NightVision, v);
|
|
5766
|
-
|
|
5774
|
+
if (nv == null)
|
|
5775
|
+
return void 0;
|
|
5776
|
+
if (isT8442(ctx)) {
|
|
5777
|
+
if (nv === NightVision.FullColor)
|
|
5778
|
+
throw new Error("nightVision: Full Color is not supported on T8442 (only Off/Infrared)");
|
|
5779
|
+
return setScalar(CAMERA_CMD.IC_NIGHT_VISION_TYPE, nv, ctx, "int-string");
|
|
5780
|
+
}
|
|
5781
|
+
return setPayload(CAMERA_CMD.NIGHT_VISION_TYPE, { channel: ctx.channel, night_sion: nv }, ctx, 0, 0, "auto");
|
|
5767
5782
|
}
|
|
5768
5783
|
},
|
|
5769
5784
|
/**
|