forked from andreeuuetoa/litsimaja
Add zone switching (#5)
Pixel calculation error Add zone switching Co-authored-by: siinus <pearu@siinus.com> Reviewed-on: pvx/litsimaja#5
This commit is contained in:
@@ -24,7 +24,11 @@ app = Flask(__name__, static_url_path='', static_folder='templates')
|
||||
|
||||
@app.route('/', methods=['GET'])
|
||||
def respondroot():
|
||||
return render_template('index.html', programs=Pl.list_all(True))
|
||||
return render_template(
|
||||
'index.html',
|
||||
programs=Pl.list_all(True),
|
||||
regions=lm.get_region_ids(),
|
||||
)
|
||||
|
||||
|
||||
@app.route('/run')
|
||||
@@ -47,4 +51,10 @@ def run_program(program):
|
||||
return Response(status=200)
|
||||
|
||||
|
||||
@app.route('/region/<region>', methods=['GET'])
|
||||
def switch_region(region):
|
||||
lm.switch_region(int(region))
|
||||
return Response(status=200)
|
||||
|
||||
|
||||
app.run('0.0.0.0', 8080)
|
||||
|
||||
Reference in New Issue
Block a user