@camstack/addon-provider-rtsp 1.2.64 → 1.2.66

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
@@ -7577,7 +7577,8 @@ var CameraSwitchAuthoritySchema = discriminatedUnion("kind", [
7577
7577
  var CameraSwitchUnavailableReasonSchema = _enum([
7578
7578
  "no-provider",
7579
7579
  "source-unreachable",
7580
- "not-configured"
7580
+ "not-configured",
7581
+ "device-disabled"
7581
7582
  ]);
7582
7583
  /**
7583
7584
  * One switch, resolved for one camera.
@@ -13099,7 +13100,12 @@ var ConfigEntrySchema = object({
13099
13100
  value: unknown(),
13100
13101
  description: string().optional()
13101
13102
  });
13102
- var LinkedDevicesModeSchema = _enum(["auto", "manual"]);
13103
+ /**
13104
+ * Only `manual` since D356: the operator picks, nothing links itself. The
13105
+ * field survives on the wire because a viewer already OTA'd parses it —
13106
+ * drop it once no shipped client reads `mode`.
13107
+ */
13108
+ var LinkedDevicesModeSchema = _enum(["manual"]);
13103
13109
  /** One resolved linked device — the compact projection consumers need. */
13104
13110
  var LinkedDeviceSchema = object({
13105
13111
  deviceId: number(),
@@ -23731,12 +23737,20 @@ var BatteryStatusSchema = object({
23731
23737
  * Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
23732
23738
  * Reolink-specific for the Solar Panel 2 accessory (will become
23733
23739
  * common on other battery cams). `'none'` means running on battery
23734
- * alone.
23740
+ * alone — a NEGATIVE the firmware actually reported.
23741
+ *
23742
+ * `'unknown'` is the absence of an answer: the provider has not read the
23743
+ * power fields yet, or the firmware reported neither. Before it existed,
23744
+ * two unreadable fields produced `'none'`, and a camera nobody had reached
23745
+ * was drawn "on battery alone" — the same D315 defect `percentage` closed
23746
+ * by going nullable. Consumers SKIP it (no charger state published, no
23747
+ * glyph, no HomeKit ChargingState) rather than coerce it either way.
23735
23748
  */
23736
23749
  charging: _enum([
23737
23750
  "dc",
23738
23751
  "solar",
23739
- "none"
23752
+ "none",
23753
+ "unknown"
23740
23754
  ]),
23741
23755
  /**
23742
23756
  * True when the camera firmware has gone into low-power mode. Battery
@@ -23826,7 +23840,7 @@ onStatusChanged: { data: object({
23826
23840
  kind: "push",
23827
23841
  empty: {
23828
23842
  percentage: 0,
23829
- charging: "none",
23843
+ charging: "unknown",
23830
23844
  sleeping: false,
23831
23845
  lastUpdated: 0
23832
23846
  }
@@ -33242,8 +33256,17 @@ var BaseDeviceProvider = class extends BaseAddon {
33242
33256
  async onRestoreDevices(savedDevices) {
33243
33257
  const restored = /* @__PURE__ */ new Set();
33244
33258
  const failures = [];
33259
+ const liveStableIds = new Set((await this.ctx.kernel.devices.getAll()).map((device) => device.stableId));
33245
33260
  const attemptRestore = async (saved) => {
33246
33261
  if (restored.has(saved.id)) return;
33262
+ if (liveStableIds.has(saved.stableId)) {
33263
+ this.ctx.logger.debug("Restore row already live — not dialled again", { tags: {
33264
+ deviceId: saved.id,
33265
+ stableId: saved.stableId
33266
+ } });
33267
+ restored.add(saved.id);
33268
+ return;
33269
+ }
33247
33270
  const Class = this.deviceClasses[saved.type];
33248
33271
  if (!Class) throw new Error(`no device class registered for type "${saved.type}"`);
33249
33272
  if (saved.parentDeviceId !== null && !restored.has(saved.parentDeviceId)) throw new Error(`parent device ${saved.parentDeviceId} not restored`);
package/dist/addon.mjs CHANGED
@@ -7553,7 +7553,8 @@ var CameraSwitchAuthoritySchema = discriminatedUnion("kind", [
7553
7553
  var CameraSwitchUnavailableReasonSchema = _enum([
7554
7554
  "no-provider",
7555
7555
  "source-unreachable",
7556
- "not-configured"
7556
+ "not-configured",
7557
+ "device-disabled"
7557
7558
  ]);
7558
7559
  /**
7559
7560
  * One switch, resolved for one camera.
@@ -13075,7 +13076,12 @@ var ConfigEntrySchema = object({
13075
13076
  value: unknown(),
13076
13077
  description: string().optional()
13077
13078
  });
13078
- var LinkedDevicesModeSchema = _enum(["auto", "manual"]);
13079
+ /**
13080
+ * Only `manual` since D356: the operator picks, nothing links itself. The
13081
+ * field survives on the wire because a viewer already OTA'd parses it —
13082
+ * drop it once no shipped client reads `mode`.
13083
+ */
13084
+ var LinkedDevicesModeSchema = _enum(["manual"]);
13079
13085
  /** One resolved linked device — the compact projection consumers need. */
13080
13086
  var LinkedDeviceSchema = object({
13081
13087
  deviceId: number(),
@@ -23707,12 +23713,20 @@ var BatteryStatusSchema = object({
23707
23713
  * Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
23708
23714
  * Reolink-specific for the Solar Panel 2 accessory (will become
23709
23715
  * common on other battery cams). `'none'` means running on battery
23710
- * alone.
23716
+ * alone — a NEGATIVE the firmware actually reported.
23717
+ *
23718
+ * `'unknown'` is the absence of an answer: the provider has not read the
23719
+ * power fields yet, or the firmware reported neither. Before it existed,
23720
+ * two unreadable fields produced `'none'`, and a camera nobody had reached
23721
+ * was drawn "on battery alone" — the same D315 defect `percentage` closed
23722
+ * by going nullable. Consumers SKIP it (no charger state published, no
23723
+ * glyph, no HomeKit ChargingState) rather than coerce it either way.
23711
23724
  */
23712
23725
  charging: _enum([
23713
23726
  "dc",
23714
23727
  "solar",
23715
- "none"
23728
+ "none",
23729
+ "unknown"
23716
23730
  ]),
23717
23731
  /**
23718
23732
  * True when the camera firmware has gone into low-power mode. Battery
@@ -23802,7 +23816,7 @@ onStatusChanged: { data: object({
23802
23816
  kind: "push",
23803
23817
  empty: {
23804
23818
  percentage: 0,
23805
- charging: "none",
23819
+ charging: "unknown",
23806
23820
  sleeping: false,
23807
23821
  lastUpdated: 0
23808
23822
  }
@@ -33218,8 +33232,17 @@ var BaseDeviceProvider = class extends BaseAddon {
33218
33232
  async onRestoreDevices(savedDevices) {
33219
33233
  const restored = /* @__PURE__ */ new Set();
33220
33234
  const failures = [];
33235
+ const liveStableIds = new Set((await this.ctx.kernel.devices.getAll()).map((device) => device.stableId));
33221
33236
  const attemptRestore = async (saved) => {
33222
33237
  if (restored.has(saved.id)) return;
33238
+ if (liveStableIds.has(saved.stableId)) {
33239
+ this.ctx.logger.debug("Restore row already live — not dialled again", { tags: {
33240
+ deviceId: saved.id,
33241
+ stableId: saved.stableId
33242
+ } });
33243
+ restored.add(saved.id);
33244
+ return;
33245
+ }
33223
33246
  const Class = this.deviceClasses[saved.type];
33224
33247
  if (!Class) throw new Error(`no device class registered for type "${saved.type}"`);
33225
33248
  if (saved.parentDeviceId !== null && !restored.has(saved.parentDeviceId)) throw new Error(`parent device ${saved.parentDeviceId} not restored`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-rtsp",
3
- "version": "1.2.64",
3
+ "version": "1.2.66",
4
4
  "description": "Generic RTSP camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",