-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcallbacks.py
70 lines (53 loc) · 1.76 KB
/
callbacks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
'''
Use callbacks to trigger custom action like notifying Slack, Discord, Telegram, ...
THIS IS THE DEFAULTS FILE!
Please copy the needed callbacks to a new file called
user_callbacks.py
This makes upgrading to newer versions easy by simply calling git pull.
'''
def credit_too_low(uid, name, **kwargs):
''' Called on scanning tag with too low credit to start a session '''
pass
def credit_low_warning(uid, name, **kwargs):
''' Called when logged in and remaining time is <= LOW_CREDIT_MINUTES '''
pass
def credit_runout(uid, name, **kwargs):
''' Called when user gets logged out due to insufficient credit '''
pass
def credit_runout_interrupt(uid, name, job_time, **kwargs):
''' Called when user gets logged out due to insufficient credit and a job was running '''
pass
def machine_turn_on(**kwargs):
''' Called on turning the machines power on '''
pass
def machine_turn_off(**kwargs):
''' Called on turning the machines power off '''
pass
def card_scan(uid, **kwargs):
''' Called on scanning a card '''
pass
def card_unknown(uid, **kwargs):
''' Called on scanning an (to the database) unknown card '''
pass
def card_unauthorized(uid, name, **kwargs):
''' Called on scanning an unauthorized card '''
pass
def card_authorized(uid, name, **kwargs):
''' Called on scanning a valid (authorized) card '''
pass
def user_logout(uid, name, **kwargs):
''' Called on manual logout '''
push_rocket('Der Lasercutter ist wieder frei.')
pass
def user_login(uid, name, **kwargs):
''' Called on login '''
pass
def job_start(uid, name, **kwargs):
''' Called on starting an job '''
pass
def job_resume(uid, name, **kwargs):
''' Called on login with currently stopped/interrupted job '''
pass
def job_end(uid, name, job_time, **kwargs):
''' Called on ending an job '''
pass