@mega-yfue/eufy-sdk 0.4.0-beta.17 → 0.4.0-beta.19
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 +22 -21
- package/dist/index.js.map +2 -2
- package/dist/model/capabilities/doorbell.d.ts +8 -9
- package/dist/model/capabilities/motion.d.ts +3 -4
- package/dist/model/param-dictionary.d.ts +3 -3
- package/dist/model/types.d.ts +10 -11
- package/dist/transport/p2p/p2p-session.d.ts +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3955,7 +3955,6 @@ var MOTION_CMD = {
|
|
|
3955
3955
|
* payload key AND pass mChannel 0 explicitly; the two are separate choices, not linked.)
|
|
3956
3956
|
*
|
|
3957
3957
|
* ⚠️ Replay + readback confirmed on a HomeBase-attached T8425 (1719 `0`→`1`→`0`), NOT byte-captured.
|
|
3958
|
-
* Provenance is `apk`, not `verified`: a divergent-but-also-accepted frame can't be ruled out.
|
|
3959
3958
|
*/
|
|
3960
3959
|
HUMAN_ONLY_AT_NIGHT: 1719,
|
|
3961
3960
|
/**
|
|
@@ -3969,7 +3968,7 @@ var MOTION_CMD = {
|
|
|
3969
3968
|
* form, so a feature that is on reads as off.
|
|
3970
3969
|
* Decoded by {@link decodeRadarWdSwitch} to match the app.
|
|
3971
3970
|
*
|
|
3972
|
-
* ⚠️ Replay + readback confirmed on a T8214 (2706 `0`→`1`→`0`), NOT byte-captured.
|
|
3971
|
+
* ⚠️ Replay + readback confirmed on a T8214 (2706 `0`→`1`→`0`), NOT byte-captured.
|
|
3973
3972
|
*/
|
|
3974
3973
|
LOITERING_DETECTION: 2706,
|
|
3975
3974
|
/**
|
|
@@ -4293,7 +4292,7 @@ var MOTION_MEMBERS = {
|
|
|
4293
4292
|
param: MOTION_CMD.HUMAN_ONLY_AT_NIGHT,
|
|
4294
4293
|
type: "bool",
|
|
4295
4294
|
kind: "boolean",
|
|
4296
|
-
provenance: "
|
|
4295
|
+
provenance: "verified",
|
|
4297
4296
|
description: "Restrict AI classification to night-time only (1719). \u26A0\uFE0F Replay + readback confirmed on a HomeBase-attached T8425, not byte-captured.",
|
|
4298
4297
|
requires: [MOTION_CMD.HUMAN_ONLY_AT_NIGHT],
|
|
4299
4298
|
write: (v, ctx) => {
|
|
@@ -4309,7 +4308,7 @@ var MOTION_MEMBERS = {
|
|
|
4309
4308
|
param: MOTION_CMD.LOITERING_DETECTION,
|
|
4310
4309
|
type: "bool",
|
|
4311
4310
|
kind: "boolean",
|
|
4312
|
-
provenance: "
|
|
4311
|
+
provenance: "verified",
|
|
4313
4312
|
coerce: (raw) => decodeRadarWdSwitch(raw) ?? false,
|
|
4314
4313
|
description: "Loitering detection \u2014 alert on lingering rather than passing (2706). Observed on the T8214 doorbell only; the read is object-OR-scalar, matching the app's own decode.",
|
|
4315
4314
|
requires: [MOTION_CMD.LOITERING_DETECTION],
|
|
@@ -6889,9 +6888,9 @@ function parseQuickResponses(voiceList) {
|
|
|
6889
6888
|
var DOORBELL_MEMBERS = {
|
|
6890
6889
|
/**
|
|
6891
6890
|
* The HOMEBASE as the doorbell's chime — the hub plays the ring, not the wired chime box
|
|
6892
|
-
* `mechanicalChimeSwitch` drives. `provenance` is "verified" on our own decrypt of the app's frame
|
|
6893
|
-
*
|
|
6894
|
-
*
|
|
6891
|
+
* `mechanicalChimeSwitch` drives. `provenance` is "verified" on our own decrypt of the app's frame:
|
|
6892
|
+
* direct-binary `[ch][value][acct]`, 1=on/0=off, the same shape as its 1703 sibling — captured, not
|
|
6893
|
+
* inferred from the shared param range.
|
|
6895
6894
|
*/
|
|
6896
6895
|
chimeSwitch: {
|
|
6897
6896
|
param: DOORBELL_CMD.CHIME_SWITCH,
|
|
@@ -6902,9 +6901,8 @@ var DOORBELL_MEMBERS = {
|
|
|
6902
6901
|
write: (v, ctx) => setScalar(DOORBELL_CMD.CHIME_SWITCH, asBool(v) ? 1 : 0, ctx, "direct-binary")
|
|
6903
6902
|
},
|
|
6904
6903
|
/**
|
|
6905
|
-
* `provenance` is "verified"
|
|
6906
|
-
*
|
|
6907
|
-
* `[ch][value][acct]`, 1=on/0=off — verified live on a T8214 (ON then OFF).
|
|
6904
|
+
* `provenance` is "verified" on our own P2P decrypt of the write wire: direct-binary
|
|
6905
|
+
* `[ch][value][acct]`, 1=on/0=off, verified live on a T8214 (ON then OFF).
|
|
6908
6906
|
*/
|
|
6909
6907
|
mechanicalChimeSwitch: {
|
|
6910
6908
|
param: DOORBELL_CMD.MECHANICAL_CHIME_SWITCH,
|
|
@@ -6935,7 +6933,7 @@ var DOORBELL_MEMBERS = {
|
|
|
6935
6933
|
type: "number",
|
|
6936
6934
|
unit: "%",
|
|
6937
6935
|
kind: "percent",
|
|
6938
|
-
provenance: "
|
|
6936
|
+
provenance: "verified",
|
|
6939
6937
|
writtenElsewhere: true,
|
|
6940
6938
|
description: "Ringtone volume (1708; confirmed on T8214, observed value 80). The WRITE is `audio`'s setRingtoneVolume \u2014 that capability owns every volume wire."
|
|
6941
6939
|
},
|
|
@@ -7040,7 +7038,7 @@ var DOORBELL_MEMBERS = {
|
|
|
7040
7038
|
param: 1710,
|
|
7041
7039
|
type: "string",
|
|
7042
7040
|
kind: "text",
|
|
7043
|
-
provenance: "
|
|
7041
|
+
provenance: "verified",
|
|
7044
7042
|
description: "Notification config JSON {notification_motion_onoff,notification_ring_onoff,notification_style} (1710; confirmed on T8214)."
|
|
7045
7043
|
},
|
|
7046
7044
|
/**
|
|
@@ -15343,8 +15341,8 @@ var P2PSession = class _P2PSession extends EventEmitter2 {
|
|
|
15343
15341
|
audioStalled = false;
|
|
15344
15342
|
audioRetransmitTimer;
|
|
15345
15343
|
lastPongData;
|
|
15346
|
-
/** When
|
|
15347
|
-
|
|
15344
|
+
/** When the selected peer last answered outbound P2P traffic on this connection. */
|
|
15345
|
+
lastPeerAt;
|
|
15348
15346
|
/** Whether the silence has already been stated, so it is traced once per connection rather than per read. */
|
|
15349
15347
|
pathStaleTraced = false;
|
|
15350
15348
|
lookupTimer;
|
|
@@ -15413,17 +15411,17 @@ var P2PSession = class _P2PSession extends EventEmitter2 {
|
|
|
15413
15411
|
/**
|
|
15414
15412
|
* How long this connection's path has been silent, or nothing where it has never answered.
|
|
15415
15413
|
*
|
|
15416
|
-
*
|
|
15417
|
-
*
|
|
15414
|
+
* PONG and ACK from the selected peer prove the path answers outbound traffic. `undefined` means no such reply
|
|
15415
|
+
* has arrived since connection, so silence alone does not establish a stale path.
|
|
15418
15416
|
*/
|
|
15419
15417
|
get pathSilentMs() {
|
|
15420
|
-
return this.
|
|
15418
|
+
return this.lastPeerAt === void 0 ? void 0 : Date.now() - this.lastPeerAt;
|
|
15421
15419
|
}
|
|
15422
15420
|
/**
|
|
15423
15421
|
* Whether this path can still be committed to, on the evidence the heartbeat gives.
|
|
15424
15422
|
*
|
|
15425
|
-
* False where
|
|
15426
|
-
* not known to be dead, so it answers true.
|
|
15423
|
+
* False where selected-peer replies arrived and then stopped for {@link PATH_SILENCE_MS}. A connection with
|
|
15424
|
+
* no post-connect reply is not known to be dead, so it answers true.
|
|
15427
15425
|
*
|
|
15428
15426
|
* Traces the silence once per connection, on the read that first observes it.
|
|
15429
15427
|
*/
|
|
@@ -15808,6 +15806,11 @@ var P2PSession = class _P2PSession extends EventEmitter2 {
|
|
|
15808
15806
|
onMessage(msg, rinfo, socket = this.socket) {
|
|
15809
15807
|
if (!socket)
|
|
15810
15808
|
return;
|
|
15809
|
+
const fromConnectedPeer = this.connected && this.connectAddress?.host === rinfo.address && this.connectAddress.port === rinfo.port;
|
|
15810
|
+
if (fromConnectedPeer && (hasHeader(msg, ResponseMessageType.PONG) || hasHeader(msg, ResponseMessageType.ACK))) {
|
|
15811
|
+
this.lastPeerAt = Date.now();
|
|
15812
|
+
this.pathStaleTraced = false;
|
|
15813
|
+
}
|
|
15811
15814
|
if (!hasHeader(msg, ResponseMessageType.DATA)) {
|
|
15812
15815
|
this.logger.debug(`[p2p] ${this.cfg.stationSn} <<< ${rinfo.address}:${rinfo.port} header=${msg.subarray(0, 2).toString("hex")} len=${msg.length}`);
|
|
15813
15816
|
}
|
|
@@ -15825,8 +15828,6 @@ var P2PSession = class _P2PSession extends EventEmitter2 {
|
|
|
15825
15828
|
this.onConnected({ host: rinfo.address, port: rinfo.port }, socket);
|
|
15826
15829
|
} else if (hasHeader(msg, ResponseMessageType.PONG)) {
|
|
15827
15830
|
this.lastPongData = msg.length > 4 ? msg.subarray(4) : void 0;
|
|
15828
|
-
this.lastPongAt = Date.now();
|
|
15829
|
-
this.pathStaleTraced = false;
|
|
15830
15831
|
} else if (hasHeader(msg, ResponseMessageType.PING)) {
|
|
15831
15832
|
this.send({ host: rinfo.address, port: rinfo.port }, RequestMessageType.PONG, void 0, socket);
|
|
15832
15833
|
} else if (hasHeader(msg, ResponseMessageType.ACK)) {
|