Added basic PIN to web interface, partially implemented back-end
This commit is contained in:
2
app.py
2
app.py
@ -60,11 +60,13 @@ def transmit():
|
||||
action = ACTION_MAP[data['action']]
|
||||
intensity = int(data.get('intensity', 0))
|
||||
lucal = bool(data.get('lucalEncoded', False))
|
||||
pin = int(data['shockerPin'])
|
||||
# If any of those failed, return an error.
|
||||
except (ValueError, KeyError):
|
||||
return {'success': False, 'message': 'Request must contain the following keys:\n'+
|
||||
'txID: int,\n'+
|
||||
'channel: int,\n'+
|
||||
'pin: int,\n'+
|
||||
'action: "shock", "vibrate" or "beep",\n'+
|
||||
'intensity (optional): int\n'+
|
||||
'lucalEncoded (optional): bool'}, 400
|
||||
|
||||
Reference in New Issue
Block a user