@apocaliss92/scrypted-reolink-native 0.4.30 → 0.4.32
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/main.nodejs.js +1 -1
- package/dist/plugin.zip +0 -0
- package/package.json +1 -1
- package/src/camera.ts +18 -9
package/dist/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/camera.ts
CHANGED
|
@@ -3538,25 +3538,34 @@ export class ReolinkCamera
|
|
|
3538
3538
|
const logger = this.getBaichuanLogger();
|
|
3539
3539
|
|
|
3540
3540
|
const settings = await this.thisDevice.getSettings();
|
|
3541
|
-
const
|
|
3542
|
-
(
|
|
3543
|
-
|
|
3541
|
+
const isPrivacyEnabled =
|
|
3542
|
+
settings.find((s) => s.key === "prebuffer:privacyMode")?.value ||
|
|
3543
|
+
settings.find((s) => s.key === "recording:privacyMode")?.value ||
|
|
3544
|
+
settings.find((s) => s.key === "snapshot:privacyMode")?.value;
|
|
3544
3545
|
const { lowThresholdBatteryRecording, highThresholdBatteryRecording } =
|
|
3545
3546
|
this.storageSettings.values;
|
|
3546
3547
|
|
|
3547
|
-
if (
|
|
3548
|
+
if (!isPrivacyEnabled && newBatteryLevel < lowThresholdBatteryRecording) {
|
|
3548
3549
|
logger.log(
|
|
3549
|
-
`
|
|
3550
|
+
`Battery level is below low threshold (${newBatteryLevel}% < ${lowThresholdBatteryRecording}%), enabling privacy mode`,
|
|
3550
3551
|
);
|
|
3551
|
-
await
|
|
3552
|
+
await Promise.all([
|
|
3553
|
+
this.thisDevice.putSetting("prebuffer:privacyMode", true),
|
|
3554
|
+
this.thisDevice.putSetting("recording:privacyMode", true),
|
|
3555
|
+
this.thisDevice.putSetting("snapshot:privacyMode", true),
|
|
3556
|
+
]);
|
|
3552
3557
|
} else if (
|
|
3553
|
-
|
|
3558
|
+
isPrivacyEnabled &&
|
|
3554
3559
|
newBatteryLevel > highThresholdBatteryRecording
|
|
3555
3560
|
) {
|
|
3556
3561
|
logger.log(
|
|
3557
|
-
`
|
|
3562
|
+
`Battery level is above high threshold (${newBatteryLevel}% > ${highThresholdBatteryRecording}%), disabling privacy mode`,
|
|
3558
3563
|
);
|
|
3559
|
-
await
|
|
3564
|
+
await Promise.all([
|
|
3565
|
+
this.thisDevice.putSetting("prebuffer:privacyMode", false),
|
|
3566
|
+
this.thisDevice.putSetting("recording:privacyMode", false),
|
|
3567
|
+
this.thisDevice.putSetting("snapshot:privacyMode", false),
|
|
3568
|
+
]);
|
|
3560
3569
|
}
|
|
3561
3570
|
}
|
|
3562
3571
|
}
|