@camstack/addon-provider-reolink 1.2.40 → 1.2.41

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/addon.js CHANGED
@@ -237324,8 +237324,8 @@ var ReolinkHub = class ReolinkHub extends BaseDevice {
237324
237324
  const cgi = info.entries[0];
237325
237325
  child.applyHubBatteryInfo({
237326
237326
  batteryPercent: info.batteryLevel,
237327
- ...typeof cgi?.["chargeStatus"] === "string" ? { chargeStatus: cgi["chargeStatus"] } : {},
237328
- ...typeof cgi?.["adapterStatus"] === "string" ? { adapterStatus: cgi["adapterStatus"] } : {}
237327
+ ...mapHubChargeStatus(cgi?.["chargeStatus"]) !== void 0 ? { chargeStatus: mapHubChargeStatus(cgi?.["chargeStatus"]) } : {},
237328
+ ...mapHubAdapterStatus(cgi?.["adapterStatus"]) !== void 0 ? { adapterStatus: mapHubAdapterStatus(cgi?.["adapterStatus"]) } : {}
237329
237329
  });
237330
237330
  }
237331
237331
  } catch (err) {
@@ -237687,6 +237687,27 @@ function discoveredStatusFor(d) {
237687
237687
  if (typeof d.state === "string" && d.state.length > 0) return "online";
237688
237688
  return "unknown";
237689
237689
  }
237690
+ /**
237691
+ * The hub CGI reports charge state as NUMERIC codes (measured live on the
237692
+ * Home Hub, 2026-08-16: a full, plugged Argus 3E reads chargeStatus 2 /
237693
+ * adapterStatus 1) while `mapBatteryInfo` speaks the standalone Baichuan
237694
+ * string vocabulary ('charging' / 'chargeComplete' / 'solarPanel'). Translate
237695
+ * at the hub boundary so the shared mapper stays untouched.
237696
+ * chargeStatus: 0 none · 1 charging · 2 charge complete
237697
+ * adapterStatus: 0 none · 1 DC adapter · 2 solar panel
237698
+ */
237699
+ function mapHubChargeStatus(value) {
237700
+ if (typeof value === "string") return value;
237701
+ if (value === 0) return "none";
237702
+ if (value === 1) return "charging";
237703
+ if (value === 2) return "chargeComplete";
237704
+ }
237705
+ function mapHubAdapterStatus(value) {
237706
+ if (typeof value === "string") return value;
237707
+ if (value === 0) return "none";
237708
+ if (value === 1) return "dc";
237709
+ if (value === 2) return "solarPanel";
237710
+ }
237690
237711
  //#endregion
237691
237712
  //#region src/creation-schema.ts
237692
237713
  /**
package/dist/addon.mjs CHANGED
@@ -237304,8 +237304,8 @@ var ReolinkHub = class ReolinkHub extends BaseDevice {
237304
237304
  const cgi = info.entries[0];
237305
237305
  child.applyHubBatteryInfo({
237306
237306
  batteryPercent: info.batteryLevel,
237307
- ...typeof cgi?.["chargeStatus"] === "string" ? { chargeStatus: cgi["chargeStatus"] } : {},
237308
- ...typeof cgi?.["adapterStatus"] === "string" ? { adapterStatus: cgi["adapterStatus"] } : {}
237307
+ ...mapHubChargeStatus(cgi?.["chargeStatus"]) !== void 0 ? { chargeStatus: mapHubChargeStatus(cgi?.["chargeStatus"]) } : {},
237308
+ ...mapHubAdapterStatus(cgi?.["adapterStatus"]) !== void 0 ? { adapterStatus: mapHubAdapterStatus(cgi?.["adapterStatus"]) } : {}
237309
237309
  });
237310
237310
  }
237311
237311
  } catch (err) {
@@ -237667,6 +237667,27 @@ function discoveredStatusFor(d) {
237667
237667
  if (typeof d.state === "string" && d.state.length > 0) return "online";
237668
237668
  return "unknown";
237669
237669
  }
237670
+ /**
237671
+ * The hub CGI reports charge state as NUMERIC codes (measured live on the
237672
+ * Home Hub, 2026-08-16: a full, plugged Argus 3E reads chargeStatus 2 /
237673
+ * adapterStatus 1) while `mapBatteryInfo` speaks the standalone Baichuan
237674
+ * string vocabulary ('charging' / 'chargeComplete' / 'solarPanel'). Translate
237675
+ * at the hub boundary so the shared mapper stays untouched.
237676
+ * chargeStatus: 0 none · 1 charging · 2 charge complete
237677
+ * adapterStatus: 0 none · 1 DC adapter · 2 solar panel
237678
+ */
237679
+ function mapHubChargeStatus(value) {
237680
+ if (typeof value === "string") return value;
237681
+ if (value === 0) return "none";
237682
+ if (value === 1) return "charging";
237683
+ if (value === 2) return "chargeComplete";
237684
+ }
237685
+ function mapHubAdapterStatus(value) {
237686
+ if (typeof value === "string") return value;
237687
+ if (value === 0) return "none";
237688
+ if (value === 1) return "dc";
237689
+ if (value === 2) return "solarPanel";
237690
+ }
237670
237691
  //#endregion
237671
237692
  //#region src/creation-schema.ts
237672
237693
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-reolink",
3
- "version": "1.2.40",
3
+ "version": "1.2.41",
4
4
  "description": "Reolink camera device provider addon for CamStack — native Baichuan protocol",
5
5
  "keywords": [
6
6
  "camstack",