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}"
def heating_route(): channel = request.args.get('ch', type=str) value = request.args.get('val', type=int) serial_send(settings[channel], value) return 'ok'
def tanksensor_route(): value = request.args.get('val', type=int) serial_send(settings['tanksensor'], value) return 'ok'
def led2_route(): serial_send(settings["led-vorschiff"], request.args.get('val', type=int)) return "ok"
def led1_route(): serial_send(settings["led-salon"], request.args.get('val', type=int)) return "ok"