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

fix:improve stop #260

Merged
merged 1 commit into from
Oct 21, 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
8 changes: 7 additions & 1 deletion ovos_workshop/skills/ovos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,12 @@ def _handle_session_stop(self, message: Message):
except Exception as e:
data["error"] = str(e)
self.log.exception(f'Failed to stop skill: {self.skill_id}: {e}')
if data["result"] and sess.session_id == "default":
# TODO - track if speech is coming from this skill!
# this is not currently tracked
self.bus.emit(message.reply("mycroft.audio.speech.stop",
{"skill_id": self.skill_id}))

self.bus.emit(message.reply(f"{self.skill_id}.stop.response", data))

def __handle_stop(self, message):
Expand All @@ -1247,7 +1253,7 @@ def __handle_stop(self, message):
self.bus.emit(message.forward(self.skill_id + ".stop"))
sess = SessionManager.get(message)
try:
stopped = self.stop_session(sess) or self.stop()
stopped = self.stop_session(sess) or self.stop() or False
LOG.debug(f"{self.skill_id} stopped: {stopped}")
if stopped:
self.bus.emit(message.reply("mycroft.stop.handled",
Expand Down
Loading