From 660de53ff026d4ffce21e59a041dce77879bc5f1 Mon Sep 17 00:00:00 2001 From: Daniel McKnight <34697904+NeonDaniel@users.noreply.github.com> Date: Thu, 4 Apr 2024 15:22:40 -0700 Subject: [PATCH] Update deprecated references to `translate` (#74) Deprecate signal patching bug in `get_response` Co-authored-by: Daniel McKnight --- __init__.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/__init__.py b/__init__.py index d033059..74b0849 100644 --- a/__init__.py +++ b/__init__.py @@ -83,8 +83,6 @@ def __init__(self, **kwargs): self.from_caffeine_informer = list() self._update_event = Event() CommonQuerySkill.__init__(self, **kwargs) - from neon_utils.signal_utils import init_signal_bus - init_signal_bus(self.bus) @classproperty def runtime_requirements(self): @@ -271,9 +269,6 @@ def CQS_action(self, phrase, data): if len(results) == 1: self.speak_dialog("stay_caffeinated") else: - # TODO: This is patching poor handling in get_response - from neon_utils.signal_utils import wait_for_signal_clear - wait_for_signal_clear("isSpeaking", 30) if self.ask_yesno("more_drinks") == "yes": LOG.info("YES") self._speak_alternate_results(message, results) @@ -361,10 +356,11 @@ def _speak_alternate_results(self, message, caff_list=None): self.speak_dialog('multiple_drinks', {'drink': drink, 'caffeine_content': caff_mg, - 'caffeine_units': self.translate( + 'caffeine_units': self.resources.render_dialog( 'word_milligrams'), 'drink_size': caff_vol, - 'drink_units': self.translate(unit_dialog)}) + 'drink_units': self.resources.render_dialog( + unit_dialog)}) spoken.append(caff_list[i][0]) sleep(0.5) # Prevent simultaneous speak inserts cnt = cnt + 1 @@ -561,7 +557,7 @@ def _generate_drink_dialog(self, drink: str, to_speak = self.dialog_renderer.render('drink_caffeine', { 'drink': drink, 'caffeine_content': caff_mg, - 'caffeine_units': self.translate('word_milligrams'), + 'caffeine_units': self.resources.render_dialog('word_milligrams'), 'drink_size': caff_vol, - 'drink_units': self.translate(unit_dialog)}) + 'drink_units': self.resources.render_dialog(unit_dialog)}) return to_speak, results