Raum mit anzeigen

This commit is contained in:
Stefan Bethke 2024-02-27 19:42:19 +01:00
parent 496e41bd4b
commit a29cbd9683
2 changed files with 5 additions and 3 deletions

View file

@ -9,11 +9,12 @@ from bottle import post, request, route, run, static_file, view
from animation import Off from animation import Off
from dmx import DMX, Bar252, StairvilleLedPar56, REDSpot18RGB from dmx import DMX, Bar252, StairvilleLedPar56, REDSpot18RGB
room = ''
@route('/') @route('/')
@view('index') @view('index')
def index(): def index():
return {'foo': 'bar'} return {'room': room}
@route('/static/<path:path>') @route('/static/<path:path>')
def static(path): def static(path):
@ -76,6 +77,7 @@ def main(args):
else: else:
print(f"Unknown room {args.room}", file=sys.stderr) print(f"Unknown room {args.room}", file=sys.stderr)
sys.exit(64) sys.exit(64)
room = args.room
dmx.animation = Off() dmx.animation = Off()
dmx.color = (0, 0, 0) dmx.color = (0, 0, 0)
dmx.animation = "off" dmx.animation = "off"

View file

@ -1,11 +1,11 @@
<html> <html>
<head> <head>
<title>Foo Baz DMX</title> <title>Foo Baz DMX - {{room}}</title>
<link rel="stylesheet" href="static/main.css"> <link rel="stylesheet" href="static/main.css">
<script src="static/main.js" defer></script> <script src="static/main.js" defer></script>
</head> </head>
<body> <body>
<h1>Foo Baz DMX</h1> <h1>Foo Baz DMX - {{room}}</h1>
<div class="controls"> <div class="controls">
<fieldset class="buttons"> <fieldset class="buttons">
<legend>Animation</legend> <legend>Animation</legend>