Example #1
0
def sound():
    while (True):
        siren.exterior(3, 1)
        # check for disarm
        try:
            panic = req.panic()
        except Exception:
            sound()
        if (panic['action'] == 'off'):
            try:
                req.updateAlarm('off')
            except Exception:
                wait()
            wait()
Example #2
0
def wait():
    print('Panic button ready. Waiting for action.')
    while (True):
        try:
            panic = req.panic()
        except Exception:
            wait()
        # check for an action
        if (panic['action'] == 'on'):
            # Sound the alarm
            try:
                req.updateAlarm('on')
            except Exception:
                sound()
            sound()
        time.sleep(config.searchFreq)