@camstack/addon-provider-reolink 1.2.35 → 1.2.36

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
@@ -230966,10 +230966,13 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
230966
230966
  const confirmDeadline = Date.now() + CONFIRM_TIMEOUT_MS;
230967
230967
  const parent = await this.getParentHub();
230968
230968
  let confirmed = false;
230969
+ let observedAwake = false;
230969
230970
  while (Date.now() < confirmDeadline) {
230970
230971
  if (parent !== null) try {
230971
- if ((await (await parent.getApi()).getNvrChannelsSummary({ channels: [this.getChannel()] })).devices.find((d) => d.channel === this.getChannel())?.sleeping === false) {
230972
+ const entry = (await (await parent.getApi()).getNvrChannelsSummary({ channels: [this.getChannel()] })).devices.find((d) => d.channel === this.getChannel());
230973
+ if (entry !== void 0 && entry.online !== false) {
230972
230974
  confirmed = true;
230975
+ observedAwake = entry.sleeping === false;
230973
230976
  break;
230974
230977
  }
230975
230978
  } catch {}
@@ -230982,13 +230985,14 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
230982
230985
  }
230983
230986
  if (state === "awake") {
230984
230987
  confirmed = true;
230988
+ observedAwake = true;
230985
230989
  break;
230986
230990
  }
230987
230991
  }
230988
230992
  await sleep$1(CONFIRM_POLL_MS);
230989
230993
  }
230990
230994
  const confirmSource = parent !== null ? "hub-summary" : "sleep-poll";
230991
- if (confirmed && this.commitSleepState(false, confirmSource)) {
230995
+ if (observedAwake && this.commitSleepState(false, confirmSource)) {
230992
230996
  this.ctx.logger.info("battery wakeForStream: wake confirmed — driving wake transition", {
230993
230997
  tags: { deviceId: this.id },
230994
230998
  meta: {
package/dist/addon.mjs CHANGED
@@ -230946,10 +230946,13 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
230946
230946
  const confirmDeadline = Date.now() + CONFIRM_TIMEOUT_MS;
230947
230947
  const parent = await this.getParentHub();
230948
230948
  let confirmed = false;
230949
+ let observedAwake = false;
230949
230950
  while (Date.now() < confirmDeadline) {
230950
230951
  if (parent !== null) try {
230951
- if ((await (await parent.getApi()).getNvrChannelsSummary({ channels: [this.getChannel()] })).devices.find((d) => d.channel === this.getChannel())?.sleeping === false) {
230952
+ const entry = (await (await parent.getApi()).getNvrChannelsSummary({ channels: [this.getChannel()] })).devices.find((d) => d.channel === this.getChannel());
230953
+ if (entry !== void 0 && entry.online !== false) {
230952
230954
  confirmed = true;
230955
+ observedAwake = entry.sleeping === false;
230953
230956
  break;
230954
230957
  }
230955
230958
  } catch {}
@@ -230962,13 +230965,14 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
230962
230965
  }
230963
230966
  if (state === "awake") {
230964
230967
  confirmed = true;
230968
+ observedAwake = true;
230965
230969
  break;
230966
230970
  }
230967
230971
  }
230968
230972
  await sleep$1(CONFIRM_POLL_MS);
230969
230973
  }
230970
230974
  const confirmSource = parent !== null ? "hub-summary" : "sleep-poll";
230971
- if (confirmed && this.commitSleepState(false, confirmSource)) {
230975
+ if (observedAwake && this.commitSleepState(false, confirmSource)) {
230972
230976
  this.ctx.logger.info("battery wakeForStream: wake confirmed — driving wake transition", {
230973
230977
  tags: { deviceId: this.id },
230974
230978
  meta: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-reolink",
3
- "version": "1.2.35",
3
+ "version": "1.2.36",
4
4
  "description": "Reolink camera device provider addon for CamStack — native Baichuan protocol",
5
5
  "keywords": [
6
6
  "camstack",