fix output class calling
This commit is contained in:
@@ -1,18 +1,16 @@
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
from flask import Blueprint, render_template, request, flash, jsonify
|
from flask import Blueprint, render_template, request, flash, jsonify
|
||||||
from gpio_handler import gpio_set_pulse
|
from gpio_handler import create_output
|
||||||
|
|
||||||
views = Blueprint('views', __name__)
|
views = Blueprint('views', __name__)
|
||||||
|
|
||||||
# gpio channels
|
# tap channels
|
||||||
r_ch1 = 26
|
tap_left=26
|
||||||
r_ch2 = 20
|
tap_right=20
|
||||||
r_ch3 = 21
|
|
||||||
|
|
||||||
# wait times
|
# create ouput handler
|
||||||
t_large_beer = 6
|
output = create_output()
|
||||||
t_small_beer = 2
|
|
||||||
|
|
||||||
@views.route('/', methods=['GET'])
|
@views.route('/', methods=['GET'])
|
||||||
def render():
|
def render():
|
||||||
@@ -22,10 +20,10 @@ def render():
|
|||||||
def choice():
|
def choice():
|
||||||
if request.form['submit_button'] == 'option_1':
|
if request.form['submit_button'] == 'option_1':
|
||||||
print("Eis usem lingge Gütterli uselah!")
|
print("Eis usem lingge Gütterli uselah!")
|
||||||
gpio_set_pulse(channel=r_ch1, time_on=t_large_beer)
|
output.gpio_set_pulse(channel=tap_left, time_on=6)
|
||||||
if request.form['submit_button'] == 'option_2':
|
if request.form['submit_button'] == 'option_2':
|
||||||
print("Eis usem rächte Gütterli uselah!")
|
print("Eis usem rächte Gütterli uselah!")
|
||||||
gpio_set_pulse(channel=r_ch2, time_on=t_large_beer)
|
output.gpio_set_pulse(channel=tap_right, time_on=6)
|
||||||
return render_template('beertap.html')
|
return render_template('beertap.html')
|
||||||
|
|
||||||
@views.route('/about', methods=['GET'])
|
@views.route('/about', methods=['GET'])
|
||||||
|
|||||||
Reference in New Issue
Block a user