Ejemplo n.º 1
0
def _exit():
    global _exit_requested
    _exit_requested = True
    _dial.unblock()
    _modem.unblock()
    _dial_thread.join()
    _modem_thread.join()
Ejemplo n.º 2
0
def _dial_main():
    while True:
        digit = _dial.read()
        if digit is None:
            break
        if digit is 0:
            _arming.set(
                lock_out=False,
                indefinite=False,
                once=False,
                timeout=None
                )
            _modem.unblock()
        elif digit is 1:
            _arming.toggle('once')
            _modem.unlock()
            _modem.unblock()
        elif digit is 2:
            _arming.toggle_timeout(time.time() + 43200.0)
            _modem.unblock()
        elif digit is 3:
            _arming.toggle_timeout(time.time() + 86400.0)
            _modem.unblock()
        elif digit is 4:
            _arming.toggle('indefinite')
            _modem.unblock()
        elif digit is 5:
            _arming.toggle('lock_out')
            _modem.unblock()