From bfe3c81ee7d4442bcef5bca57928f5b5967c31c0 Mon Sep 17 00:00:00 2001 From: Sandro Zimmermann Date: Sat, 6 Dec 2025 14:52:36 +0100 Subject: [PATCH] simplify command --- py/speech_coltrol_led.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/speech_coltrol_led.py b/py/speech_coltrol_led.py index af508f5..1825277 100644 --- a/py/speech_coltrol_led.py +++ b/py/speech_coltrol_led.py @@ -9,10 +9,10 @@ GPIO.setmode(GPIO.BCM) GPIO.setup(LED_PIN, GPIO.OUT) def trigger_action(command): - if "turn on the light" in command.lower(): + if "on" in command.lower(): GPIO.output(LED_PIN, GPIO.HIGH) print("Light ON") - elif "turn off the light" in command.lower(): + elif "off" in command.lower(): GPIO.output(LED_PIN, GPIO.LOW) print("Light OFF")