@camstack/system 1.2.11 → 1.2.13
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.
|
@@ -779,7 +779,9 @@ var SnapshotAddon = class SnapshotAddon extends require_dist.BaseAddon {
|
|
|
779
779
|
*/
|
|
780
780
|
async isDeviceSleeping(deviceId) {
|
|
781
781
|
try {
|
|
782
|
-
const
|
|
782
|
+
const handle = (await this.ctx.fetchDevice(deviceId)).state.battery;
|
|
783
|
+
await handle.refresh();
|
|
784
|
+
const raw = handle.value;
|
|
783
785
|
const parsed = require_dist.BatteryStatusSchema.safeParse(raw);
|
|
784
786
|
return parsed.success && parsed.data.sleeping;
|
|
785
787
|
} catch (err) {
|
|
@@ -774,7 +774,9 @@ var SnapshotAddon = class SnapshotAddon extends BaseAddon {
|
|
|
774
774
|
*/
|
|
775
775
|
async isDeviceSleeping(deviceId) {
|
|
776
776
|
try {
|
|
777
|
-
const
|
|
777
|
+
const handle = (await this.ctx.fetchDevice(deviceId)).state.battery;
|
|
778
|
+
await handle.refresh();
|
|
779
|
+
const raw = handle.value;
|
|
778
780
|
const parsed = BatteryStatusSchema.safeParse(raw);
|
|
779
781
|
return parsed.success && parsed.data.sleeping;
|
|
780
782
|
} catch (err) {
|