Subversion Repositories alarming

Compare Revisions

No changes between revisions

Regard whitespace Rev 7 → Rev 8

/trunk/Server/daemon.py
186,12 → 186,14
print "ALERT {0}, but nobody is listening!".format(server_targets)
 
if pvget(postvars, "action")[0] == "motion_on": # 1.3.6.1.4.1.37476.2.4.1.100
# TODO: Actually, we should call this API "alarm_on" instead of "motion_on", since we also enable a doorbell checker
print "Motion start"
if config.enable_motion_detect:
os.system(os.path.dirname(os.path.abspath(__file__)) + "/motion/motion_start_safe")
if config.enable_doorbell_listener:
g_bellListenerProc = sp.Popen(['python3',os.path.dirname(os.path.abspath(__file__)) + "/doorbell/bell_listener.py"])
g_bellListenerProc = sp.Popen([os.path.dirname(os.path.abspath(__file__)) + "/doorbell/bell_listener.py"])
if pvget(postvars, "action")[0] == "motion_off": # 1.3.6.1.4.1.37476.2.4.1.101
# TODO: Actually, we should call this API "alarm_off" instead of "motion_off", since we also disable a doorbell checker
print "Motion stop"
if config.enable_motion_detect:
os.system(os.path.dirname(os.path.abspath(__file__)) + "/motion/motion_stop_safe")
/trunk/Server/manual_alarm_off
0,0 → 1,26
#!/usr/bin/php
<?php
 
# --- PLEASE MODIFY:
 
# To which daemon server should the alarm be sent?
$url = "http://127.0.0.1:8085";
 
# --- DON'T MODIFY AFTER THIS LINE
 
$fields = array();
$fields[] = "action=motion_off"; // 1.3.6.1.4.1.37476.2.4.1.101
 
$fields_string = implode('&', $fields);
 
echo urldecode($fields_string)."\n";
 
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 
$result = curl_exec($ch);
 
echo $result;
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/trunk/Server/manual_alarm_on
0,0 → 1,26
#!/usr/bin/php
<?php
 
# --- PLEASE MODIFY:
 
# To which daemon server should the alarm be sent?
$url = "http://127.0.0.1:8085";
 
# --- DON'T MODIFY AFTER THIS LINE
 
$fields = array();
$fields[] = "action=motion_on"; // 1.3.6.1.4.1.37476.2.4.1.100
 
$fields_string = implode('&', $fields);
 
echo urldecode($fields_string)."\n";
 
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 
$result = curl_exec($ch);
 
echo $result;
Property changes:
Added: svn:executable
+*
\ No newline at end of property