hotwords is K

master
bel 2023-03-25 21:44:34 -06:00
parent c46fe808fd
commit 6ce38738f5
1 changed files with 5 additions and 5 deletions

View File

@ -148,7 +148,7 @@ class Reactor(threading.Thread):
for i in hotwords:
if i in cleantext:
log(f"Reactor.handle: found hotword '{i}' in '{text}' as '{cleantext}'")
self.outq.put(i)
self.outq.put((i, text))
class Actor(threading.Thread):
def __init__(self, inq):
@ -158,14 +158,14 @@ class Actor(threading.Thread):
def run(self):
log("Actor.run: start")
while True:
hotword = self.inq.get()
hotword, context = self.inq.get()
if hotword is None:
break
self.handle(hotword)
self.handle(hotword, context)
log("Actor.run: stop")
def handle(self, hotword):
print(hotword)
def handle(self, hotword, context):
print(f'{hotword} in {context}')
if __name__ == "__main__":
main()