mirror of
https://github.com/koush/scrypted.git
synced 2026-09-21 11:10:40 +01:00
hikvision: autoconfigure should disable vca resource
This commit is contained in:
4
plugins/hikvision/package-lock.json
generated
4
plugins/hikvision/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/hikvision",
|
||||
"version": "0.0.152",
|
||||
"version": "0.0.153",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/hikvision",
|
||||
"version": "0.0.152",
|
||||
"version": "0.0.153",
|
||||
"license": "Apache",
|
||||
"dependencies": {
|
||||
"@scrypted/common": "file:../../common",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/hikvision",
|
||||
"version": "0.0.152",
|
||||
"version": "0.0.153",
|
||||
"description": "Hikvision Plugin for Scrypted",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache",
|
||||
|
||||
@@ -19,6 +19,7 @@ export interface HikvisionAPI {
|
||||
checkStreamSetup(channel: string, isOld: boolean): Promise<HikvisionCameraStreamSetup>;
|
||||
jpegSnapshot(channel: string, timeout: number): Promise<Buffer>;
|
||||
listenEvents(): Promise<Destroyable>;
|
||||
putVcaResource(channel: string, resource: 'smart' | 'facesnap' | 'close'): Promise<boolean>;
|
||||
getCodecs(camNumber: string): Promise<MediaStreamOptions[]>;
|
||||
configureCodecs(camNumber: string, channelNumber: string, options: MediaStreamOptions): Promise<MediaStreamConfiguration>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,11 @@ export const hikvisionAutoConfigureSettings: Setting = {
|
||||
};
|
||||
|
||||
export async function autoconfigureSettings(client: HikvisionAPI, camNumber: string) {
|
||||
if (!await client.putVcaResource(camNumber + '01', 'close')) {
|
||||
client.reboot();
|
||||
throw new Error('Camera VCA resource was disabled to enable the third stream. Try again after the camera has completed rebooting.');
|
||||
}
|
||||
|
||||
return ac(
|
||||
() => client.getCodecs(camNumber),
|
||||
(options) => {
|
||||
|
||||
Reference in New Issue
Block a user