示例#1
0
def edit_settings():
    setting = request.args.get('s', type=str)
    value = request.args.get('v', type=int)
    try:
        serial_send(settings[setting], value)
    except KeyError:
        return f"Setting {setting} could not be found"
    except Exception as ex:
        return f"Unknown error: {type(ex)}, {ex}"
    return f"Successfully set {setting} to {value}"
示例#2
0
def heating_route():
    channel = request.args.get('ch', type=str)
    value = request.args.get('val', type=int)
    serial_send(settings[channel], value)
    return 'ok'
示例#3
0
def tanksensor_route():
    value = request.args.get('val', type=int)
    serial_send(settings['tanksensor'], value)
    return 'ok'
示例#4
0
def led2_route():
    serial_send(settings["led-vorschiff"], request.args.get('val', type=int))
    return "ok"
示例#5
0
def led1_route():
    serial_send(settings["led-salon"], request.args.get('val', type=int))
    return "ok"