simplify command
This commit is contained in:
parent
bfe3c81ee7
commit
034aebee3c
@ -9,10 +9,10 @@ GPIO.setmode(GPIO.BCM)
|
|||||||
GPIO.setup(LED_PIN, GPIO.OUT)
|
GPIO.setup(LED_PIN, GPIO.OUT)
|
||||||
|
|
||||||
def trigger_action(command):
|
def trigger_action(command):
|
||||||
if "on" in command.lower():
|
if "light" in command.lower():
|
||||||
GPIO.output(LED_PIN, GPIO.HIGH)
|
GPIO.output(LED_PIN, GPIO.HIGH)
|
||||||
print("Light ON")
|
print("Light ON")
|
||||||
elif "off" in command.lower():
|
elif "dark" in command.lower():
|
||||||
GPIO.output(LED_PIN, GPIO.LOW)
|
GPIO.output(LED_PIN, GPIO.LOW)
|
||||||
print("Light OFF")
|
print("Light OFF")
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user