klasse motor test
This commit is contained in:
parent
b805cbe501
commit
cf0846244f
@ -36,9 +36,10 @@ def main():
|
|||||||
@kamera_server.route("/<changePin>/<action>")
|
@kamera_server.route("/<changePin>/<action>")
|
||||||
def action(changePin, action):
|
def action(changePin, action):
|
||||||
# Convert the pin from the URL into an integer:
|
# Convert the pin from the URL into an integer:
|
||||||
changePin = int(changePin)
|
|
||||||
# Get the device name for the pin being changed:
|
# Get the device name for the pin being changed:
|
||||||
deviceName = pins_out[changePin]['name']
|
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 the action part of the URL is "on," execute the code indented below:
|
||||||
if action == "on":
|
if action == "on":
|
||||||
# Set the pin high:
|
# Set the pin high:
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
<h2>{{ pins[pin].name }}
|
<h2>{{ pins[pin].name }}
|
||||||
{% if pins[pin].state == true %}
|
{% if pins[pin].state == true %}
|
||||||
ist gerade <strong>an</strong></h2><div class="row"><div class="col-md-2">
|
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 %}
|
{% else %}
|
||||||
ist gerade <strong>aus</strong></h2><div class="row"><div class="col-md-2">
|
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 %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for pin in pins_in %}
|
{% for pin in pins_in %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user