diff --git a/kamera_server.py b/kamera_server.py index 125f8fc..bebf43e 100644 --- a/kamera_server.py +++ b/kamera_server.py @@ -36,9 +36,10 @@ def main(): @kamera_server.route("//") 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: diff --git a/templates/main.html b/templates/main.html index 1a6c549..4964e34 100644 --- a/templates/main.html +++ b/templates/main.html @@ -14,10 +14,10 @@

{{ pins[pin].name }} {% if pins[pin].state == true %} ist gerade an

+ Turn off {% else %} ist gerade aus + Turn on {% endif %} {% endfor %} {% for pin in pins_in %}