disable motion detection right after motion daemon is started, if
authorCalin Crisan <ccrisan@gmail.com>
Wed, 7 Jan 2015 18:56:55 +0000 (20:56 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Wed, 7 Jan 2015 18:56:59 +0000 (20:56 +0200)
disabled by config

src/motionctl.py

index f03532245ece62714f9e293e8f66205eb85cf954..b55ea3a0bb9c06f3f345d74c5f98da519c04ca65 100644 (file)
@@ -15,7 +15,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>. 
 
-import datetime
 import errno
 import logging
 import os.path
@@ -25,7 +24,6 @@ import subprocess
 import time
 
 from tornado.httpclient import HTTPClient, AsyncHTTPClient, HTTPRequest
-from tornado.ioloop import IOLoop
 
 import config
 import settings
@@ -62,7 +60,7 @@ def find_motion():
     return _motion_binary_cache
 
 
-def _disable_motion_detection():
+def _disable_initial_motion_detection():
     for camera_id in config.get_camera_ids():
         camera_config = config.get_camera(camera_id)
         if not utils.local_camera(camera_config):
@@ -121,7 +119,7 @@ def start():
     with open(motion_pid_path, 'w') as f:
         f.write(str(pid) + '\n')
     
-    IOLoop.instance().add_timeout(datetime.timedelta(seconds=5), _disable_motion_detection)
+    _disable_initial_motion_detection()
 
 
 def stop():