@apocaliss92/scrypted-reolink-native 0.0.2 → 0.0.3
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 +15 -24
package/dist/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/camera.ts
CHANGED
|
@@ -621,15 +621,14 @@ export class ReolinkNativeCamera extends ScryptedDeviceBase implements VideoCame
|
|
|
621
621
|
logger.error('Failed to refresh abilities', e);
|
|
622
622
|
}
|
|
623
623
|
|
|
624
|
-
// try {
|
|
625
|
-
// await this.refreshAuxDevicesStatus();
|
|
626
|
-
// }
|
|
627
|
-
// catch (e) {
|
|
628
|
-
// logger.error('Failed to refresh device status', e);
|
|
629
|
-
// }
|
|
630
|
-
|
|
631
624
|
try {
|
|
625
|
+
await this.refreshAuxDevicesStatus();
|
|
626
|
+
}
|
|
627
|
+
catch (e) {
|
|
628
|
+
logger.error('Failed to refresh device status', e);
|
|
629
|
+
}
|
|
632
630
|
|
|
631
|
+
try {
|
|
633
632
|
const interfaces = await this.getDeviceInterfaces();
|
|
634
633
|
|
|
635
634
|
const device: Device = {
|
|
@@ -1101,6 +1100,11 @@ export class ReolinkNativeCamera extends ScryptedDeviceBase implements VideoCame
|
|
|
1101
1100
|
return Boolean(capabilities?.hasBattery);
|
|
1102
1101
|
}
|
|
1103
1102
|
|
|
1103
|
+
hasIntercom() {
|
|
1104
|
+
const capabilities = this.getAbilities();
|
|
1105
|
+
return Boolean(capabilities?.hasIntercom);
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1104
1108
|
getPtzCapabilities() {
|
|
1105
1109
|
const capabilities = this.getAbilities();
|
|
1106
1110
|
const hasZoom = Boolean(capabilities?.hasZoom);
|
|
@@ -1133,33 +1137,20 @@ export class ReolinkNativeCamera extends ScryptedDeviceBase implements VideoCame
|
|
|
1133
1137
|
];
|
|
1134
1138
|
|
|
1135
1139
|
try {
|
|
1136
|
-
// Expose Intercom if the camera supports Baichuan talkback.
|
|
1137
|
-
try {
|
|
1138
|
-
const api = this.getClient();
|
|
1139
|
-
if (api) {
|
|
1140
|
-
const ability = await api.getTalkAbility(this.getRtspChannel());
|
|
1141
|
-
if (Array.isArray((ability as any)?.audioConfigList) && (ability as any).audioConfigList.length > 0) {
|
|
1142
|
-
interfaces.push(ScryptedInterface.Intercom);
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
catch {
|
|
1147
|
-
// ignore: camera likely doesn't support talkback
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
1140
|
const { hasPtz } = this.getPtzCapabilities();
|
|
1151
1141
|
|
|
1152
1142
|
if (hasPtz) {
|
|
1153
1143
|
interfaces.push(ScryptedInterface.PanTiltZoom);
|
|
1154
1144
|
}
|
|
1155
|
-
|
|
1156
|
-
interfaces.push(ScryptedInterface.ObjectDetector);
|
|
1157
|
-
}
|
|
1145
|
+
interfaces.push(ScryptedInterface.ObjectDetector);
|
|
1158
1146
|
if (this.hasSiren() || this.hasFloodlight() || this.hasPirEvents())
|
|
1159
1147
|
interfaces.push(ScryptedInterface.DeviceProvider);
|
|
1160
1148
|
if (this.hasBattery()) {
|
|
1161
1149
|
interfaces.push(ScryptedInterface.Battery, ScryptedInterface.Sleep);
|
|
1162
1150
|
}
|
|
1151
|
+
if (this.hasIntercom()) {
|
|
1152
|
+
interfaces.push(ScryptedInterface.Intercom);
|
|
1153
|
+
}
|
|
1163
1154
|
} catch (e) {
|
|
1164
1155
|
this.getLogger().error('Error getting device interfaces', e);
|
|
1165
1156
|
}
|