@scrypted/amcrest
Advanced tools
Comparing version 0.0.118 to 0.0.119
{ | ||
"name": "@scrypted/amcrest", | ||
"version": "0.0.118", | ||
"version": "0.0.119", | ||
"description": "Amcrest Plugin for Scrypted", | ||
@@ -5,0 +5,0 @@ "author": "Scrypted", |
@@ -21,2 +21,3 @@ import AxiosDigestAuth from '@koush/axios-digest-auth'; | ||
DahuaTalkHangup = "Code=PassiveHungup;action=Start", | ||
DahuaCallDeny = "Code=HungupPhone;action=Pulse", | ||
DahuaTalkPulse = "Code=_CallNoAnswer_;action=Pulse", | ||
@@ -23,0 +24,0 @@ } |
@@ -159,2 +159,4 @@ import { ffmpegLogInitialOutput } from '@scrypted/common/src/media-helpers'; | ||
const doorbellType = this.storage.getItem('doorbellType'); | ||
const callerId = this.storage.getItem('callerID'); | ||
const multipleCallIds = this.storage.getItem('multipleCallIds') === 'true'; | ||
@@ -186,3 +188,12 @@ let pulseTimeout: NodeJS.Timeout; | ||
|| event === AmcrestEvent.DahuaTalkInvite) { | ||
this.binaryState = true; | ||
if (event === AmcrestEvent.DahuaTalkInvite && payload && multipleCallIds) | ||
{ | ||
if (payload.includes(callerId)) | ||
{ | ||
this.binaryState = true; | ||
} | ||
} else | ||
{ | ||
this.binaryState = true; | ||
} | ||
} | ||
@@ -192,2 +203,3 @@ else if (event === AmcrestEvent.TalkHangup | ||
|| event === AmcrestEvent.AlarmIPCStop | ||
|| event === AmcrestEvent.DahuaCallDeny | ||
|| event === AmcrestEvent.DahuaTalkHangup) { | ||
@@ -247,3 +259,33 @@ this.binaryState = false; | ||
twoWayAudio = isDoorbell ? 'Amcrest' : 'None'; | ||
if (doorbellType == DAHUA_DOORBELL_TYPE) | ||
{ | ||
ret.push( | ||
{ | ||
title: 'Multiple Call Buttons', | ||
key: 'multipleCallIds', | ||
description: 'Some Dahua Doorbells integrate multiple Call Buttons for apartment buildings.', | ||
type: 'boolean', | ||
value: (this.storage.getItem('multipleCallIds') === 'true').toString(), | ||
} | ||
); | ||
} | ||
const multipleCallIds = this.storage.getItem('multipleCallIds'); | ||
if (multipleCallIds) | ||
{ | ||
ret.push( | ||
{ | ||
title: 'Caller ID', | ||
key: 'callerID', | ||
description: 'Caller ID', | ||
type: 'number', | ||
value: this.storage.getItem('callerID'), | ||
} | ||
) | ||
} | ||
ret.push( | ||
@@ -268,3 +310,7 @@ { | ||
return ret; | ||
} | ||
@@ -271,0 +317,0 @@ async takeSmartCameraPicture(option?: PictureOptions): Promise<MediaObject> { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
387681
1372