add HomeAssistant module and use execute command

This commit is contained in:
2024-05-02 12:55:27 +07:00
parent 6021db52aa
commit 8f1aa07507
6 changed files with 54 additions and 4 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
def execute_cmd(self, cmd: str):
def execute_cmd(self, cmd: str, recognized_phrase: str, voice: str):
if cmd == 'thanks':
self.play("thanks")
elif cmd == 'stupid':
@@ -7,3 +7,5 @@ def execute_cmd(self, cmd: str):
self.play("off", True)
self.porcupine.delete()
exit(0)
elif cmd == 'home_assistant':
self.home_assistant.send_process(recognized_phrase)