Commit c55d6934 authored by Kristian Tan's avatar Kristian Tan

Cast input ints to strings

parent 13a1c406
...@@ -32,7 +32,7 @@ def main(): ...@@ -32,7 +32,7 @@ def main():
# The function below is executed when someone requests a URL with the pin number and action in it: # The function below is executed when someone requests a URL with the pin number and action in it:
@app.route("/<change_pin>/<action>") @app.route("/<change_pin>/<action>")
def action(change_pin, action): def action(change_pin, action):
print("Input value before change: " + GPIO.input(change_pin)) print("Input value before change: " + str(GPIO.input(change_pin)))
change_pin = int(change_pin) change_pin = int(change_pin)
device_name = pins[change_pin]['name'] device_name = pins[change_pin]['name']
...@@ -48,7 +48,7 @@ def action(change_pin, action): ...@@ -48,7 +48,7 @@ def action(change_pin, action):
for pin in pins: for pin in pins:
pins[pin]['state'] = GPIO.input(pin) pins[pin]['state'] = GPIO.input(pin)
print("Input value after change: " + GPIO.input(change_pin)) print("Input value after change: " + str(GPIO.input(change_pin)))
template_data = { template_data = {
'message': message, 'message': message,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment