From ad1db2c960fb4dc18653f6b0ae87675d96807f73 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 8 Sep 2021 13:57:34 -0400 Subject: [PATCH] Only suspend/resume motion detection if the monitor is doing motion detection --- scripts/ZoneMinder/lib/ZoneMinder/Monitor.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Monitor.pm b/scripts/ZoneMinder/lib/ZoneMinder/Monitor.pm index 2e47fa610..d01ef3455 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Monitor.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Monitor.pm @@ -279,6 +279,7 @@ sub disconnect { sub suspendMotionDetection { my $self = shift; return 0 if ! ZoneMinder::Memory::zmMemVerify($self); + return if $$self{Function} eq 'Nodect' or $$self{Function} eq 'Monitor' or $$self{Function} eq 'None'; my $count = 50; while ($count and ZoneMinder::Memory::zmMemRead($self, 'shared_data:active', 1)) { ZoneMinder::Logger::Debug(1, 'Suspending motion detection'); @@ -297,6 +298,7 @@ sub suspendMotionDetection { sub resumeMotionDetection { my $self = shift; return 0 if ! ZoneMinder::Memory::zmMemVerify($self); + return if $$self{Function} eq 'Nodect' or $$self{Function} eq 'Monitor' or $$self{Function} eq 'None'; my $count = 50; while ($count and !ZoneMinder::Memory::zmMemRead($self, 'shared_data:active', 1)) { ZoneMinder::Logger::Debug(1, 'Resuming motion detection');