server_microphone.py aktualisiert

This commit is contained in:
2026-02-08 18:39:56 +00:00
parent 7501d0fb1e
commit 447d41a4b1

View File

@@ -51,57 +51,57 @@ async def run_test():
print(finalResult) print(finalResult)
if "licht" in finalResult and "an" in finalResult and activation_word in finalResult and run_stop_only_once_flag: if "licht" in finalResult and "an" in finalResult and activation_word in finalResult and run_stop_only_once_flag:
print("SCHALTER EIN!") print("SCHALTER EIN!")
pixels.wakeup() pixels.think()
time.sleep(1) time.sleep(1)
pixels.off() pixels.off()
avm_sid.lights_on() avm_sid.lights_on()
run_stop_only_once_flag = False run_stop_only_once_flag = False
if "licht" in finalResult and "aus" in finalResult and activation_word in finalResult and run_stop_only_once_flag: if "licht" in finalResult and "aus" in finalResult and activation_word in finalResult and run_stop_only_once_flag:
print("SCHALTER AUS!") print("SCHALTER AUS!")
pixels.wakeup() pixels.think()
time.sleep(1) time.sleep(1)
pixels.off() pixels.off()
avm_sid.lights_off() avm_sid.lights_off()
run_stop_only_once_flag = False run_stop_only_once_flag = False
if "blinken" in finalResult and activation_word in finalResult and run_stop_only_once_flag: if "blinken" in finalResult and activation_word in finalResult and run_stop_only_once_flag:
print("Blinken!") print("Blinken!")
pixels.wakeup() pixels.think()
time.sleep(2) time.sleep(2)
pixels.off() pixels.off()
run_stop_only_once_flag = False run_stop_only_once_flag = False
if "nachrichten" in finalResult and activation_word in finalResult and run_stop_only_once_flag: if "nachrichten" in finalResult and activation_word in finalResult and run_stop_only_once_flag:
pixels.wakeup() pixels.think()
time.sleep(1) time.sleep(1)
pixels.off() pixels.off()
subprocess.Popen(["sh", "/home/pi/tagesschau/start_news.sh"]) subprocess.Popen(["sh", "/home/pi/tagesschau/start_news.sh"])
run_stop_only_once_flag = False run_stop_only_once_flag = False
if "saarland" in finalResult and activation_word in finalResult and run_stop_only_once_flag: if "saarland" in finalResult and activation_word in finalResult and run_stop_only_once_flag:
pixels.wakeup() pixels.think()
time.sleep(1) time.sleep(1)
pixels.off() pixels.off()
subprocess.Popen(["sh", "/home/pi/tagesschau/start_platt.sh"]) subprocess.Popen(["sh", "/home/pi/tagesschau/start_platt.sh"])
run_stop_only_once_flag = False run_stop_only_once_flag = False
if "nova" in finalResult and activation_word in finalResult and run_stop_only_once_flag: if "nova" in finalResult and activation_word in finalResult and run_stop_only_once_flag:
pixels.wakeup() pixels.think()
time.sleep(1) time.sleep(1)
pixels.off() pixels.off()
subprocess.Popen(["sh", "/home/pi/radio/start_nova.sh"]) subprocess.Popen(["sh", "/home/pi/radio/start_nova.sh"])
run_stop_only_once_flag = False run_stop_only_once_flag = False
if "funk" in finalResult and activation_word in finalResult and run_stop_only_once_flag: if "funk" in finalResult and activation_word in finalResult and run_stop_only_once_flag:
pixels.wakeup() pixels.think()
time.sleep(1) time.sleep(1)
pixels.off() pixels.off()
subprocess.Popen(["sh", "/home/pi/radio/start_dlf.sh"]) subprocess.Popen(["sh", "/home/pi/radio/start_dlf.sh"])
run_stop_only_once_flag = False run_stop_only_once_flag = False
if ("stop" in finalResult or "stopp" in finalResult) and activation_word in finalResult and run_stop_only_once_flag: if ("stop" in finalResult or "stopp" in finalResult) and activation_word in finalResult and run_stop_only_once_flag:
pixels.wakeup() pixels.think()
time.sleep(1) time.sleep(1)
pixels.off() pixels.off()
subprocess.Popen(["sh", "/home/pi/tagesschau/end_news.sh"]) subprocess.Popen(["sh", "/home/pi/tagesschau/end_news.sh"])
run_stop_only_once_flag = False run_stop_only_once_flag = False
if "result" in finalResult and not run_stop_only_once_flag: if "result" in finalResult and not run_stop_only_once_flag:
run_stop_only_once_flag = True run_stop_only_once_flag = True
pixels.think() pixels.wakeup()
time.sleep(1) time.sleep(1)
pixels.off() pixels.off()