Skip to content

Commit

Permalink
videoanalysis: fix bug where motion sensor would stop on invalid cond…
Browse files Browse the repository at this point in the history
…ition
  • Loading branch information
koush committed Mar 31, 2023
1 parent e43acca commit 5f23873
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions plugins/objectdetector/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/objectdetector/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/objectdetector",
"version": "0.0.120",
"version": "0.0.121",
"description": "Scrypted Video Analysis Plugin. Installed alongside a detection service like OpenCV or TensorFlow.",
"author": "Scrypted",
"license": "Apache-2.0",
Expand Down
4 changes: 1 addition & 3 deletions plugins/objectdetector/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ class ObjectDetectionMixin extends SettingsMixinDeviceBase<VideoCamera & Camera
if (this.hasMotionType)
this.motionDetected = false;

this.detectorRunning = false;
this.endObjectDetection();

this.maybeStartMotionDetection();
Expand Down Expand Up @@ -333,8 +332,7 @@ class ObjectDetectionMixin extends SettingsMixinDeviceBase<VideoCamera & Camera
if (!this.detectorRunning) {
break;
}
const now = Date.now();
if (now > this.analyzeStop) {
if (!this.hasMotionType && Date.now() > this.analyzeStop) {
break;
}

Expand Down

0 comments on commit 5f23873

Please sign in to comment.