aboutsummaryrefslogtreecommitdiff
path: root/alarm-tools/sample.py
blob: 0adac18f0a629613e186f20121cece64018109e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python

# NOTE: Requires PYTHONPATH to be set to ../lib/python if using the working
#       tree module

import alarms
import time

if __name__ == "__main__":
    sock = alarms.connect("/tmp/alarmd")
    uuid = alarms.register_alarm(sock, "Test alarm")
    time.sleep(10)
    alarms.raise_alarm(sock, uuid)
    time.sleep(10)
    alarms.clear_alarm(sock, uuid)
    time.sleep(10)
    alarms.deregister_alarm(sock, uuid)
    alarms.disconnect(sock)