Skip to content

Commit

Permalink
added adapt intent parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
mushie4282 committed Apr 27, 2024
1 parent 52eb4cb commit 0130f09
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
14 changes: 13 additions & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def my_setting(self):
@intent_handler("Texting.intent")
def handle_text_intent(self, message):
"""This is a Padatious intent handler.
It is triggered using a list of sample phrases."""
It is triggered using a list of sample phrases. (Texting.intent)"""
self.speak_dialog("text.response")
phone = SIM7600X() # create SMS instance
try:
Expand All @@ -61,6 +61,18 @@ def handle_text_intent(self, message):
# in case the HAT is not responsive
self.speak_dialog("error.response")

@intent_handler(IntentBuilder("TextIntent").require("SmsKey"))
def handle_text_adapt_intent(self, message):
# Triggered by Keyword (SmsKey.voc)
self.speak_dialog("text.response")
phone = SIM7600X() # create SMS instance
try:
phone.send_short_message("Send help to 1250 N Bellflower Blvd, Long Beach, CA 90840")
self.speak_dialog("text.complete")
except:
# in case the HAT is not responsive
self.speak_dialog("error.response")

def stop(self):
"""Optional action to take when "stop" is requested by the user.
This method should return True if it stopped something or
Expand Down
1 change: 0 additions & 1 deletion src/locale/en-us/regex/Law.rx

This file was deleted.

2 changes: 0 additions & 2 deletions src/locale/en-us/vocab/HelloWorldKeyword.voc

This file was deleted.

3 changes: 3 additions & 0 deletions src/locale/en-us/vocab/SmsKey.voc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
emergency
9 1 1
911

0 comments on commit 0130f09

Please sign in to comment.