@apocaliss92/scrypted-reolink-native 0.5.4 → 0.5.6
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/accessories/siren.ts +1 -4
- package/src/camera.ts +4 -13
package/dist/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/accessories/siren.ts
CHANGED
|
@@ -26,8 +26,6 @@ export class ReolinkCameraSiren extends ScryptedDeviceBase implements OnOff {
|
|
|
26
26
|
await this.camera.withBaichuanRetry(async () => {
|
|
27
27
|
const api = await this.camera.ensureClient();
|
|
28
28
|
await api.setSiren(channel, false);
|
|
29
|
-
const sirenState = await api.getSiren(channel);
|
|
30
|
-
this.on = sirenState.enabled;
|
|
31
29
|
});
|
|
32
30
|
this.logger.log(`Siren toggle: turnOff ok (device=${this.nativeId})`);
|
|
33
31
|
} catch (e: any) {
|
|
@@ -48,11 +46,10 @@ export class ReolinkCameraSiren extends ScryptedDeviceBase implements OnOff {
|
|
|
48
46
|
await this.camera.withBaichuanRetry(async () => {
|
|
49
47
|
const api = await this.camera.ensureClient();
|
|
50
48
|
await api.setSiren(channel, true);
|
|
51
|
-
const sirenState = await api.getSiren(channel);
|
|
52
|
-
this.on = sirenState.enabled;
|
|
53
49
|
});
|
|
54
50
|
this.logger.log(`Siren toggle: turnOn ok (device=${this.nativeId})`);
|
|
55
51
|
} catch (e: any) {
|
|
52
|
+
this.on = false;
|
|
56
53
|
this.logger.error(
|
|
57
54
|
`Siren toggle: turnOn failed (device=${this.nativeId})`,
|
|
58
55
|
e?.message || String(e),
|
package/src/camera.ts
CHANGED
|
@@ -2787,19 +2787,10 @@ export class ReolinkCamera
|
|
|
2787
2787
|
}
|
|
2788
2788
|
}
|
|
2789
2789
|
|
|
2790
|
-
//
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
} else {
|
|
2795
|
-
try {
|
|
2796
|
-
const sirenState = await api.getSiren(channel);
|
|
2797
|
-
this.siren.on = sirenState.enabled;
|
|
2798
|
-
} catch (e) {
|
|
2799
|
-
logger.warn("Failed to align siren state", e?.message || String(e));
|
|
2800
|
-
}
|
|
2801
|
-
}
|
|
2802
|
-
}
|
|
2790
|
+
// Siren direct control: state is managed manually by turnOn/turnOff.
|
|
2791
|
+
// The camera reports siren as "off" immediately after triggering (fire-and-forget),
|
|
2792
|
+
// so polling would always reset the switch to OFF. We skip alignment entirely
|
|
2793
|
+
// and let the user control the switch: ON triggers the siren, OFF stops it.
|
|
2803
2794
|
|
|
2804
2795
|
// Align motion-floodlight state
|
|
2805
2796
|
if (hasFloodlight && this.motionFloodlight) {
|