Skip to content

Commit

Permalink
amcrest: add motion pulse
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Apr 8, 2024
1 parent ab90e2e commit ae63e60
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions plugins/amcrest/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/amcrest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/amcrest",
"version": "0.0.148",
"version": "0.0.149",
"description": "Amcrest Plugin for Scrypted",
"author": "Scrypted",
"license": "Apache",
Expand Down
1 change: 1 addition & 0 deletions plugins/amcrest/src/amcrest-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export interface AmcrestEventData {
export enum AmcrestEvent {
MotionStart = "Code=VideoMotion;action=Start",
MotionStop = "Code=VideoMotion;action=Stop",
MotionInfo = "Code=VideoMotionInfo;action=State",
AudioStart = "Code=AudioMutation;action=Start",
AudioStop = "Code=AudioMutation;action=Stop",
TalkInvite = "Code=_DoTalkAction_;action=Invite",
Expand Down
5 changes: 5 additions & 0 deletions plugins/amcrest/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ class AmcrestCamera extends RtspSmartCamera implements VideoCameraConfiguration,
this.motionDetected = true;
resetMotionTimeout();
}
else if (event === AmcrestEvent.MotionInfo) {
// this seems to be a motion pulse
if (this.motionDetected)
resetMotionTimeout();
}
else if (event === AmcrestEvent.MotionStop) {
// use resetMotionTimeout
}
Expand Down

0 comments on commit ae63e60

Please sign in to comment.