hotwords is K
parent
c46fe808fd
commit
6ce38738f5
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue