Commit d52c0ff8 authored by Kristian Tan's avatar Kristian Tan

Cast input ints to strings

parent c55d6934
...@@ -32,9 +32,9 @@ def main(): ...@@ -32,9 +32,9 @@ 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: " + 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']
print("Input value before change: " + str(GPIO.input(change_pin)))
if action == "on": if action == "on":
GPIO.output(change_pin, GPIO.HIGH) GPIO.output(change_pin, GPIO.HIGH)
......
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