Skip to content

Commit

Permalink
Merge branch 'dev' into FEAT_NewVoice
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejgray authored Jul 11, 2024
2 parents 0011998 + 6820a0f commit 34365bb
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 9 deletions.
7 changes: 6 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def handle_exit_shutdown_intent(self, message):
:param message: message object associated with request
"""
confirm_number = str(randint(100, 999))
self.gui.show_text(confirm_number,
self.resources.render_dialog("word_confirm"))
validator = numeric_confirmation_validator(confirm_number)
if message.data.get("exit"):
action = SystemCommand.EXIT
Expand All @@ -139,7 +141,10 @@ def handle_exit_shutdown_intent(self, message):
response = self.get_response("ask_exit_shutdown",
{"action": action.value,
"number": confirm_number},
validator, "action_not_confirmed")
validator, "action_not_confirmed",
num_retries=3)
LOG.debug(f"Got response: {response}")
self.gui.clear()
if not response:
self.speak_dialog("confirm_cancel", private=True)
elif response:
Expand Down
1 change: 1 addition & 0 deletions locale/en-us/dialog/word_confirm.dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go ahead
3 changes: 2 additions & 1 deletion locale/en-us/vocab/no.voc → locale/en-us/vocab/cancel.voc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ nope
nah
negative
nevermind
never mind
never mind
cancel
1 change: 1 addition & 0 deletions locale/uk-ua/dialog/word_confirm.dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
продовжуй
File renamed without changes.
3 changes: 2 additions & 1 deletion test/test_resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ vocab:
- "enable"
- "exit"
- "listening"
- "no"
- "cancel"
- "request"
- "restart"
- "shutdown"
Expand Down Expand Up @@ -59,6 +59,7 @@ dialog:
- wakeword_failed_to_disable
- ask_enable
- confirm_change
- word_confirm

# regex entities, not necessarily filenames
regex:
Expand Down
10 changes: 5 additions & 5 deletions test/test_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_handle_exit_shutdown_intent(self):
# Exit Confirmed
message = Message("valid_intent", {"exit": "exit"})

def get_response(*args):
def get_response(*args, **kwargs):
self.assertEqual(args[0], "ask_exit_shutdown")
dialog = args[0]
dialog_data = args[1]
Expand Down Expand Up @@ -103,7 +103,7 @@ def get_response(*args):
# Shutdown confirmed
message = Message("valid_intent", {"shutdown": "shut down"})

def get_response(*args):
def get_response(*args, **kwargs):
self.assertEqual(args[0], "ask_exit_shutdown")
dialog = args[0]
dialog_data = args[1]
Expand Down Expand Up @@ -131,7 +131,7 @@ def get_response(*args):
# Restart Confirmed
message = Message("valid_intent", {"restart": "reboot"})

def get_response(*args):
def get_response(*args, **kwargs):
self.assertEqual(args[0], "ask_exit_shutdown")
dialog = args[0]
dialog_data = args[1]
Expand Down Expand Up @@ -160,7 +160,7 @@ def get_response(*args):
self.skill._do_exit_shutdown.reset_mock()
message = Message("valid_intent", {"exit": "exit"})

def get_response(*args):
def get_response(*args, **kwargs):
self.assertEqual(args[0], "ask_exit_shutdown")
dialog = args[0]
dialog_data = args[1]
Expand All @@ -187,7 +187,7 @@ def get_response(*args):
# Exit no response
message = Message("valid_intent", {"exit": "exit"})

def get_response(*args):
def get_response(*args, **kwargs):
self.assertEqual(args[0], "ask_exit_shutdown")
dialog = args[0]
dialog_data = args[1]
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

__version__ = "1.1.1a1"
__version__ = "1.1.1a2"

0 comments on commit 34365bb

Please sign in to comment.