Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deprecated references #74

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading