Skip to content

Commit

Permalink
Minor update to app and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
FutureSharks committed Mar 20, 2016
1 parent 34621d9 commit d181cbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ To install, use pip:
sudo pip install https://github.com/FutureSharks/rpi-security/zipball/master
sudo systemctl daemon-reload
sudo systemctl enable rpi-security.service
sudo systemctl start rpi-security.service

Add your MAC address or addresses and Pushbullet API key to ``/etc/rpi-security.conf``.

Expand Down
7 changes: 4 additions & 3 deletions bin/rpi-security.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def update_alarm_state(new_alarm_state):
update_alarm_state('disabled')
continue
elif 'body' in pushes[0] and pushes[0]['body'].lower() == 'status':
pb_send_notifcation(body = send_status(alarm_state), title = 'rpi-security')
pb_send_notifcation(body = send_status(alarm_state), title = 'rpi-security: status')
elif alarm_state['current_state'] == 'disabled':
update_alarm_state('disarmed')
if alarm_state['current_state'] != 'disabled':
Expand Down Expand Up @@ -244,13 +244,14 @@ def get_interface_mac_addr(network_interface):
result = f.read().strip()
return result

def exit(signal = None, frame = None):
def clean_exit(signal = None, frame = None):
log_message("rpi-security stopping...")
GPIO.cleanup()
sys.exit(0)

def exit_with_error(message):
log_message(message)
GPIO.cleanup()
sys.exit(1)

def set_global_vars():
Expand Down Expand Up @@ -305,4 +306,4 @@ def set_global_vars():
while 1:
time.sleep(100)
except KeyboardInterrupt:
exit()
clean_exit()

0 comments on commit d181cbc

Please sign in to comment.