@mega-yfue/eufy-sdk 0.6.0-beta.37 → 0.6.0-beta.38
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 +11 -1
- package/dist/index.js.map +2 -2
- package/dist/model/capabilities/battery.d.ts +3 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4800,11 +4800,20 @@ function cellGated(members) {
|
|
|
4800
4800
|
});
|
|
4801
4801
|
return Object.fromEntries(gated);
|
|
4802
4802
|
}
|
|
4803
|
+
var notSensor = (ctx) => ctx.codec !== "sensor";
|
|
4804
|
+
function notOnSensor(members) {
|
|
4805
|
+
const gated = Object.entries(members).map(([name, m]) => {
|
|
4806
|
+
const own = m.available;
|
|
4807
|
+
const available = own ? (ctx) => notSensor(ctx) && own(ctx) : notSensor;
|
|
4808
|
+
return [name, { ...m, available }];
|
|
4809
|
+
});
|
|
4810
|
+
return Object.fromEntries(gated);
|
|
4811
|
+
}
|
|
4803
4812
|
function isChargingState(v) {
|
|
4804
4813
|
const n = Number(v);
|
|
4805
4814
|
return n !== 0 && n !== 2;
|
|
4806
4815
|
}
|
|
4807
|
-
var
|
|
4816
|
+
var CAMERA_BATTERY_MEMBERS = cellGated({
|
|
4808
4817
|
/**
|
|
4809
4818
|
* The headline percentage, and this capability's detection evidence: reporting 1101 is what proves a
|
|
4810
4819
|
* device is battery-powered, which is also the fact `MediaProvider` reads to decide a stream needs a
|
|
@@ -5031,6 +5040,7 @@ var BATTERY_MEMBERS = cellGated({
|
|
|
5031
5040
|
description: "Raw GET_CAMERA_INFO value (1103), meaning unevidenced \u2014 read live as the constant 5 on a T8170 at 92% and a T8171 at 27%, so it is NOT a low-battery flag."
|
|
5032
5041
|
}
|
|
5033
5042
|
});
|
|
5043
|
+
var BATTERY_MEMBERS = notOnSensor(CAMERA_BATTERY_MEMBERS);
|
|
5034
5044
|
var BATTERY = {
|
|
5035
5045
|
capability: "battery",
|
|
5036
5046
|
description: "Battery level, charging, health, temperature, and solar input.",
|