improve gpio handler

This commit is contained in:
aaron
2022-07-17 13:28:07 +02:00
parent f776d0ed71
commit 2a6ce4b929
4 changed files with 90 additions and 74 deletions

View File

@@ -1,7 +1,7 @@
import json
from flask import Blueprint, render_template, request, flash, jsonify
from gpio_handler import gpio_test, draw_beer
from gpio_handler import gpio_set_pulse
views = Blueprint('views', __name__)
@@ -22,10 +22,10 @@ def render():
def choice():
if request.form['submit_button'] == 'option_1':
print("Eis usem lingge Gütterli uselah!")
draw_beer(channel=r_ch1, wait=t_large_beer)
gpio_set_pulse(channel=r_ch1, time_on=t_large_beer)
if request.form['submit_button'] == 'option_2':
print("Eis usem rächte Gütterli uselah!")
draw_beer(channel=r_ch2, wait=t_large_beer)
gpio_set_pulse(channel=r_ch2, time_on=t_large_beer)
return render_template('beertap.html')
@views.route('/about', methods=['GET'])