def slack_update_door(): before_request() action = if_toggle(request.form.get('text')) if action in supported_actions: return 'The door is ' + send_command(action)['status'] + '!' else: return "This command " + action + " is not supported!"
def update_door(): before_request() action = if_toggle(request.get_json(force=True)['action']) if action in supported_actions: return jsonify(send_command(action)) else: return jsonify({'error': 'command: ' + action + ' unknown'})