@mega-yfue/eufy-sdk 0.2.0-beta.5 → 0.2.0-beta.7

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
@@ -9865,6 +9865,70 @@ function toNumberArray(arr) {
9865
9865
  return result;
9866
9866
  }
9867
9867
 
9868
+ // dist/model/capabilities/display.js
9869
+ var DISPLAY_PARAM = { BATTERY: 8001, SOFTWARE_VERSION: 8003 };
9870
+ var DISPLAY_MEMBERS = {
9871
+ /**
9872
+ * Battery level, 0-100.
9873
+ *
9874
+ * **On this capability rather than on `battery`, and that is the line partition doing its job.** The
9875
+ * security-line `battery` capability reads param 1101 and a Smart Display's charge is 8001 in its own
9876
+ * id space — two wires that happen to mean the same thing. One capability reading both would be a claim
9877
+ * that the two ecosystems share a param space, so a consumer reads a display's charge through
9878
+ * `dev.display()` and a camera's through `dev.battery()`.
9879
+ *
9880
+ * `verified` rather than `mega`: the id is in the device's cloud record, but the NAME came from the
9881
+ * maintainer's own knowledge of the hardware rather than from the cloud data-point list, and `"100"`
9882
+ * fits brightness, volume or charge equally.
9883
+ *
9884
+ * The scale is `percent` on the reading itself, not on convention alone: a full charge reads `255` on a
9885
+ * 0-255 scale and `1000` on a 0-1000 one, so `"100"` on a charged unit is positive evidence for 0-100
9886
+ * rather than merely consistent with it. What nobody has done is watch it MOVE, which is why a value
9887
+ * frozen at 100 would not yet be distinguishable from a healthy one.
9888
+ */
9889
+ battery: {
9890
+ param: DISPLAY_PARAM.BATTERY,
9891
+ type: "number",
9892
+ unit: "%",
9893
+ kind: "percent",
9894
+ provenance: "verified",
9895
+ description: "Battery level, 0-100 (param 8001)."
9896
+ },
9897
+ /**
9898
+ * Version-shaped, and that shape is the whole of the evidence — hence `guessed`, and hence no typed
9899
+ * getter: a caller reading this off a bound object cannot see the label.
9900
+ *
9901
+ * `unexposed` rather than absent, so the schema still carries its type and that label and
9902
+ * `getProperty("softwareVersion")` still answers. `dev.info()?.firmwareVersion` is the field to trust
9903
+ * where the cloud record carries one; on this display it does not, which is the only reason 8003 is
9904
+ * named at all.
9905
+ */
9906
+ softwareVersion: {
9907
+ param: DISPLAY_PARAM.SOFTWARE_VERSION,
9908
+ type: "string",
9909
+ kind: "text",
9910
+ provenance: "guessed",
9911
+ unexposed: true,
9912
+ description: "Version-shaped string (param 8003), meaning unconfirmed \u2014 prefer `info.firmwareVersion`."
9913
+ }
9914
+ };
9915
+ var DISPLAY = {
9916
+ capability: "display",
9917
+ line: "display",
9918
+ description: "Smart Display battery level (param 8001, display namespace).",
9919
+ members: DISPLAY_MEMBERS,
9920
+ properties: propertiesOf(DISPLAY_MEMBERS),
9921
+ /**
9922
+ * Claimed by CODEC, not by an evidence param.
9923
+ *
9924
+ * 8001 is in the device's cloud record, so the ordinary evidence gate would install the getter anyway
9925
+ * — but the capability should attach to a Smart Display that has reported nothing yet too, because a
9926
+ * device on this line has no other capability to carry it. The line partition keeps this off
9927
+ * everything else: `display` is the only codec in the `display` line.
9928
+ */
9929
+ detection: { codecs: ["display"] }
9930
+ };
9931
+
9868
9932
  // dist/model/capabilities/locate.js
9869
9933
  var LOCATE_DP = 160;
9870
9934
  var LEGACY_LOCATE_DP = TUYA_VACUUM_DP.LOOK_FOR_SWEEPER;
@@ -9993,6 +10057,7 @@ var MODULES = [
9993
10057
  VACUUM_DOCK,
9994
10058
  SUCTION,
9995
10059
  LOCATE,
10060
+ DISPLAY,
9996
10061
  INFO
9997
10062
  ];
9998
10063
  var BY_CAP = new Map(MODULES.map((m) => [m.capability, m]));
@@ -10037,7 +10102,7 @@ var CODEC_LINE = {
10037
10102
  mower: "clean",
10038
10103
  light: "life",
10039
10104
  printer: "print",
10040
- display: "security"
10105
+ display: "display"
10041
10106
  };
10042
10107
  function lineAllows(module, codec) {
10043
10108
  const line = module.line ?? "security";
@@ -12137,6 +12202,28 @@ var CLEAN_PARAMS = {
12137
12202
  provenance: "mega"
12138
12203
  }
12139
12204
  };
12205
+ var DISPLAY_PARAMS = {
12206
+ 8001: {
12207
+ name: "battery",
12208
+ type: "number",
12209
+ provenance: "verified"
12210
+ },
12211
+ 8003: {
12212
+ name: "softwareVersion",
12213
+ type: "string",
12214
+ provenance: "guessed"
12215
+ },
12216
+ 8005: {
12217
+ name: "modelName",
12218
+ type: "string",
12219
+ provenance: "mega"
12220
+ },
12221
+ 8006: {
12222
+ name: "modelCode",
12223
+ type: "string",
12224
+ provenance: "mega"
12225
+ }
12226
+ };
12140
12227
 
12141
12228
  // dist/model/life-params.js
12142
12229
  var LIFE_PARAMS = {
@@ -12164,7 +12251,10 @@ var TABLES = {
12164
12251
  // 3D-printer (ankermake) id space — empty until a live capture confirms the param↔semantic map
12165
12252
  // (printer-support plan Stage 3). Present so the printer codec resolves to its OWN namespace rather
12166
12253
  // than falling through to `security` and decoding another line's dictionary.
12167
- print: {}
12254
+ print: {},
12255
+ // Smart Display (T87Ax) — ids 8001-8006, four of them named. Same reason as `print`: its own
12256
+ // dictionary rather than a corner of another line's.
12257
+ display: DISPLAY_PARAMS
12168
12258
  };
12169
12259
  function paramDef(ns, paramType) {
12170
12260
  return TABLES[ns][paramType];
@@ -12179,7 +12269,7 @@ var NAMESPACE_BY_CODEC = {
12179
12269
  mower: "clean",
12180
12270
  light: "life",
12181
12271
  printer: "print",
12182
- display: "security"
12272
+ display: "display"
12183
12273
  };
12184
12274
  function namespaceForCodec(codec) {
12185
12275
  return NAMESPACE_BY_CODEC[codec];
@@ -25541,6 +25631,7 @@ export {
25541
25631
  CusPushEvent,
25542
25632
  CusPushMode,
25543
25633
  DEFAULT_KEEPALIVE_MS,
25634
+ DISPLAY_MEMBERS,
25544
25635
  DOCK_ACTIVITIES,
25545
25636
  DOCK_KINDS,
25546
25637
  DOORBELL_MEMBERS,