@mega-yfue/eufy-sdk 0.5.0-beta.40 → 0.5.0-beta.42
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
CHANGED
|
@@ -11191,6 +11191,8 @@ var MODEL_REGISTRY = {
|
|
|
11191
11191
|
// shows a parent, so an attached cam never advertises the hub's guard mode.
|
|
11192
11192
|
T8170: { codec: "camera", caps: ["battery", "arming"], name: "SoloCam" },
|
|
11193
11193
|
T8171: { codec: "camera", caps: ["battery", "arming"], name: "T8171" },
|
|
11194
|
+
// Baby Monitor E21, vendor deviceType 86 (category eufy_care), standalone.
|
|
11195
|
+
T8354: { codec: "camera", name: "Baby Monitor E21" },
|
|
11194
11196
|
T8400: { codec: "camera", caps: ["arming"], name: "Indoor Cam" },
|
|
11195
11197
|
T8410: { codec: "camera", caps: ["arming"], name: "Indoor Cam Pan & Tilt" },
|
|
11196
11198
|
T8442: { codec: "camera", caps: ["arming"], name: "Indoor/Outdoor Cam 1080p" },
|
|
@@ -24275,12 +24277,17 @@ async function probeBrokerInstance(ip, creds, opts) {
|
|
|
24275
24277
|
});
|
|
24276
24278
|
const timer = setTimeout(() => finish({ granted: false, error: "timeout" }), timeoutMs);
|
|
24277
24279
|
client.on("connect", () => {
|
|
24278
|
-
client.subscribe(opts.topic, { qos: 1 }, (err, granted) => {
|
|
24279
|
-
if (err)
|
|
24280
|
-
|
|
24280
|
+
client.subscribe(opts.topic, { qos: 1 }, (err, granted, packet) => {
|
|
24281
|
+
if (err) {
|
|
24282
|
+
const code = packet?.granted?.[0];
|
|
24283
|
+
return finish({
|
|
24284
|
+
granted: false,
|
|
24285
|
+
grantedQos: typeof code === "number" ? code : void 0,
|
|
24286
|
+
error: err.message
|
|
24287
|
+
});
|
|
24288
|
+
}
|
|
24281
24289
|
const g = granted?.[0];
|
|
24282
|
-
|
|
24283
|
-
finish({ granted: !denied, grantedQos: g?.qos });
|
|
24290
|
+
finish({ granted: !!g, grantedQos: g?.qos });
|
|
24284
24291
|
});
|
|
24285
24292
|
});
|
|
24286
24293
|
client.on("error", (err) => finish({ granted: false, error: err.message }));
|
|
@@ -24706,8 +24713,9 @@ var MqttCommandRouter = class _MqttCommandRouter {
|
|
|
24706
24713
|
* One exception is known: a single garage unit whose own-cert SUBSCRIBE was denied on every candidate
|
|
24707
24714
|
* while a phone-extracted cert granted on the same one, with a sibling of the same model on the same
|
|
24708
24715
|
* account granting fine. That is a per-device authorization gap on the vendor's backend, not a
|
|
24709
|
-
* broker-instance problem and not something this SDK works around —
|
|
24710
|
-
* (
|
|
24716
|
+
* broker-instance problem and not something this SDK works around — the throw below names each
|
|
24717
|
+
* candidate's outcome (its SUBACK deny code, a timeout or a connection error) until the backend grants
|
|
24718
|
+
* the account's own credentials.
|
|
24711
24719
|
*
|
|
24712
24720
|
* One fresh, explicitly non-reconnecting (`reconnectPeriod: 0`) connection per call — it repays the
|
|
24713
24721
|
* full mTLS handshake every command and tears the socket down right after (see
|
|
@@ -24736,7 +24744,7 @@ var MqttCommandRouter = class _MqttCommandRouter {
|
|
|
24736
24744
|
});
|
|
24737
24745
|
const winner = results.find((res) => res.granted);
|
|
24738
24746
|
if (!winner) {
|
|
24739
|
-
throw new Error(`ensureSecurityMqttFor(${dev.sn}): no broker instance currently holds this device's session (probed ${results.length} candidate IPs
|
|
24747
|
+
throw new Error(`ensureSecurityMqttFor(${dev.sn}): no broker instance currently holds this device's session (probed ${results.length} candidate IPs: ` + results.map((r) => `${r.ip} ${r.grantedQos === void 0 ? "" : `SUBACK 0x${r.grantedQos.toString(16)} `}${r.error ?? "denied"}`).join("; ") + `).`);
|
|
24740
24748
|
}
|
|
24741
24749
|
const m = new SecureMqtt({
|
|
24742
24750
|
credentials: creds,
|