@app.route('/alarm/<on>', methods=['POST'])
def alarm(on):
    details = {}
    if turnAlarm((on == 'on')):
        now = datetime.datetime.now()
        timeString = now.strftime('%Y-%m-%d %H:%M')
        details.update({'time': timeString})
    return jsonify(**details)
@app.route('/alarm/<on>', methods=['POST'])
def alarm(on):
    details = {}
    if turnAlarm((on == 'on')):
        now = datetime.datetime.now()
        timeString = now.strftime('%Y-%m-%d %H:%M')
        details.update({'time': timeString})
    return jsonify(**details)