Rename open_door() to unlock_door()
This is a better name for what the function actually does. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
3ef9283d6f
commit
c70d81fdad
7
doors.py
7
doors.py
|
@ -54,9 +54,8 @@ OFF = 0 # Low voltage, ground
|
||||||
ON = 1 # High voltage
|
ON = 1 # High voltage
|
||||||
|
|
||||||
|
|
||||||
#When door is open
|
def unlock_door():
|
||||||
def open_door():
|
print("Door is unlocked");
|
||||||
print("Door is open");
|
|
||||||
GPIO.output(DOOR_STRIKE, ON)
|
GPIO.output(DOOR_STRIKE, ON)
|
||||||
GPIO.output(RED_LED, OFF)
|
GPIO.output(RED_LED, OFF)
|
||||||
GPIO.output(GREEN_LED, ON)
|
GPIO.output(GREEN_LED, ON)
|
||||||
|
@ -99,7 +98,7 @@ def verify_key(key):
|
||||||
GPIO.output(YELLOW_LED, ON);
|
GPIO.output(YELLOW_LED, ON);
|
||||||
with request.urlopen(SERVER + ("/%s" % key)) as f:
|
with request.urlopen(SERVER + ("/%s" % key)) as f:
|
||||||
if f.read().decode() == "OK":
|
if f.read().decode() == "OK":
|
||||||
open_door()
|
unlock_door()
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
close_door()
|
close_door()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue