Subversion Repositories alarming

Rev

Rev 6 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6 Rev 8
Line 184... Line 184...
184
 
184
 
185
                if found_g == 0:
185
                if found_g == 0:
186
                        print "ALERT {0}, but nobody is listening!".format(server_targets)
186
                        print "ALERT {0}, but nobody is listening!".format(server_targets)
187
 
187
 
188
        if pvget(postvars, "action")[0] == "motion_on": # 1.3.6.1.4.1.37476.2.4.1.100
188
        if pvget(postvars, "action")[0] == "motion_on": # 1.3.6.1.4.1.37476.2.4.1.100
-
 
189
                # TODO: Actually, we should call this API "alarm_on" instead of "motion_on", since we also enable a doorbell checker
189
                print "Motion start"
190
                print "Motion start"
190
                if config.enable_motion_detect:
191
                if config.enable_motion_detect:
191
                        os.system(os.path.dirname(os.path.abspath(__file__)) + "/motion/motion_start_safe")
192
                        os.system(os.path.dirname(os.path.abspath(__file__)) + "/motion/motion_start_safe")
192
                if config.enable_doorbell_listener:
193
                if config.enable_doorbell_listener:
193
                        g_bellListenerProc = sp.Popen(['python3',os.path.dirname(os.path.abspath(__file__)) + "/doorbell/bell_listener.py"])
194
                        g_bellListenerProc = sp.Popen([os.path.dirname(os.path.abspath(__file__)) + "/doorbell/bell_listener.py"])
194
        if pvget(postvars, "action")[0] == "motion_off": # 1.3.6.1.4.1.37476.2.4.1.101
195
        if pvget(postvars, "action")[0] == "motion_off": # 1.3.6.1.4.1.37476.2.4.1.101
-
 
196
                # TODO: Actually, we should call this API "alarm_off" instead of "motion_off", since we also disable a doorbell checker
195
                print "Motion stop"
197
                print "Motion stop"
196
                if config.enable_motion_detect:
198
                if config.enable_motion_detect:
197
                        os.system(os.path.dirname(os.path.abspath(__file__)) + "/motion/motion_stop_safe")
199
                        os.system(os.path.dirname(os.path.abspath(__file__)) + "/motion/motion_stop_safe")
198
                if config.enable_doorbell_listener:
200
                if config.enable_doorbell_listener:
199
                        sp.Popen.terminate(g_bellListenerProc)
201
                        sp.Popen.terminate(g_bellListenerProc)