klasse motor test

This commit is contained in:
Bernd Reuther 2021-03-04 10:35:24 +01:00
parent b805cbe501
commit cf0846244f
2 changed files with 4 additions and 3 deletions

View File

@ -36,9 +36,10 @@ def main():
@kamera_server.route("/<changePin>/<action>")
def action(changePin, action):
# Convert the pin from the URL into an integer:
changePin = int(changePin)
# Get the device name for the pin being changed:
deviceName = pins_out[changePin]['name']
changePin = pins_out[changePin]['nr']
# If the action part of the URL is "on," execute the code indented below:
if action == "on":
# Set the pin high:

View File

@ -14,10 +14,10 @@
<h2>{{ pins[pin].name }}
{% if pins[pin].state == true %}
ist gerade <strong>an</strong></h2><div class="row"><div class="col-md-2">
<a href="/{{pins[pin].nr}}/off" class="btn btn-block btn-lg btn-default" role="button">Turn off</a></div></div>
<a href="/{{pin}}/off" class="btn btn-block btn-lg btn-default" role="button">Turn off</a></div></div>
{% else %}
ist gerade <strong>aus</strong></h2><div class="row"><div class="col-md-2">
<a href="/{{pins[pin].nr}}/on" class="btn btn-block btn-lg btn-primary" role="button">Turn on</a></div></div>
<a href="/{{pin}}/on" class="btn btn-block btn-lg btn-primary" role="button">Turn on</a></div></div>
{% endif %}
{% endfor %}
{% for pin in pins_in %}