From cf0846244fc4eba2d3619ee3068698404a09cf01 Mon Sep 17 00:00:00 2001 From: Bernd Reuther Date: Thu, 4 Mar 2021 10:35:24 +0100 Subject: [PATCH] klasse motor test --- kamera_server.py | 3 ++- templates/main.html | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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 %}