Skip to content

Commit

Permalink
Update deprecated references to translate (#74)
Browse files Browse the repository at this point in the history
Deprecate signal patching bug in `get_response`

Co-authored-by: Daniel McKnight <[email protected]>
  • Loading branch information
NeonDaniel and NeonDaniel authored Apr 4, 2024
1 parent 1340d5c commit 660de53
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 660de53

Please sign in to comment.