Skip to content

Commit

Permalink
Merge pull request #263 from OpenVoiceOS/release-2.0.0a1
Browse files Browse the repository at this point in the history
Release 2.0.0a1
  • Loading branch information
JarbasAl authored Oct 31, 2024
2 parents 23e5650 + 9ee0099 commit 81ab3ae
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 42 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Changelog

## [1.0.3a1](https://github.com/OpenVoiceOS/OVOS-workshop/tree/1.0.3a1) (2024-10-21)
## [2.0.0a1](https://github.com/OpenVoiceOS/OVOS-workshop/tree/2.0.0a1) (2024-10-31)

[Full Changelog](https://github.com/OpenVoiceOS/OVOS-workshop/compare/1.0.2...1.0.3a1)
[Full Changelog](https://github.com/OpenVoiceOS/OVOS-workshop/compare/1.0.3...2.0.0a1)

**Merged pull requests:**
**Breaking changes:**

- fix:improve stop [\#260](https://github.com/OpenVoiceOS/OVOS-workshop/pull/260) ([JarbasAl](https://github.com/JarbasAl))
- fix:duplicate\_handled\_message [\#262](https://github.com/OpenVoiceOS/OVOS-workshop/pull/262) ([JarbasAl](https://github.com/JarbasAl))



Expand Down
5 changes: 1 addition & 4 deletions ovos_workshop/skills/auto_translatable.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,7 @@ def universal_fallback_handler(message):
# auto_Translate input
message = self.translate_message(message)
LOG.info(get_handler_name(handler))
success = handler(self, message)
if success:
self.activate()
return success
return handler(self, message)

return universal_fallback_handler

Expand Down
5 changes: 2 additions & 3 deletions ovos_workshop/skills/common_query_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ def bind(self, bus):
self.add_event('question:query', self.__handle_question_query,
speak_errors=False)
self.add_event('question:action', self.__handle_query_action,
handler_info='mycroft.skill.handler',
activation=True, is_intent=True,
speak_errors=False)
self.add_event("ovos.common_query.ping", self.__handle_common_query_ping,
speak_errors=False)
Expand Down Expand Up @@ -242,15 +244,12 @@ def __handle_query_action(self, message: Message):
if message.data["skill_id"] != self.skill_id:
# Not for this skill!
return
self.activate()
phrase = message.data["phrase"]
data = message.data.get("callback_data") or {}
if data.get("answer"):
self.speak(data["answer"])
# Invoke derived class to provide playback data
self.CQS_action(phrase, data)
self.bus.emit(message.forward("mycroft.skill.handler.complete",
{"handler": "common_query"}))

@abstractmethod
def CQS_match_query_phrase(self, phrase: str) -> \
Expand Down
5 changes: 1 addition & 4 deletions ovos_workshop/skills/fallback.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def _handle_fallback_request(self, message: Message):
try:
handler_name = get_handler_name(handler)
# call handler, conditionally activating the skill
status = self._conditional_activate(handler, message=message)
status = handler(message)
if status:
# indicate completion
break
Expand All @@ -199,9 +199,6 @@ def _handle_fallback_request(self, message: Message):
self.bus.emit(message.forward(
f"ovos.skills.fallback.{self.skill_id}.response",
data={"result": status, "fallback_handler": handler_name}))
if status:
self.bus.emit(message.forward("ovos.utterance.handled",
{"handler": handler_name}))

def register_fallback(self, handler: callable, priority: int):
"""
Expand Down
26 changes: 2 additions & 24 deletions ovos_workshop/skills/ovos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1140,27 +1140,6 @@ def _handle_converse_ack(self, message: Message):
"can_handle": self.converse_is_implemented},
context={"skill_id": self.skill_id}))

def _conditional_activate(self, handler, *args, **kwargs):
"""internal helper method, only calls self.activate()
if the handler returns True and does not call self.deactivate()"""
# if handler calls self.deactivate() we do
# NOT want to reactivate the skill
was_deactivated = False

def on_deac(message):
nonlocal was_deactivated
if message.data.get("skill_id") == self.skill_id:
was_deactivated = True

self.bus.on("intent.service.skills.deactivate", on_deac)
# call skill method
result = handler(*args, **kwargs)
# conditional activation
if not was_deactivated and result:
self.activate() # renew activation
self.bus.remove("intent.service.skills.deactivate", on_deac)
return result

def _on_timeout(self):
"""_handle_converse_request timed out and was forcefully killed by ovos-core"""
message = dig_for_message()
Expand Down Expand Up @@ -1191,8 +1170,7 @@ def _handle_converse_request(self, message: Message):
"lang": standardize_lang_tag(message.data['lang'])}
kwargs = {k: v for k, v in kwargs.items() if k in params}

# call skill converse method, conditionally activating the skill
result = self._conditional_activate(self.converse, **kwargs)
result = self.converse(**kwargs)

self.bus.emit(message.reply('skill.converse.response',
{"skill_id": self.skill_id,
Expand Down Expand Up @@ -1615,7 +1593,7 @@ def speak(self, utterance: str, expect_response: bool = False,
# registers the skill as being active
meta = meta or {}
meta['skill'] = self.skill_id
self.enclosure.register(self.skill_id)

data = {'utterance': utterance,
'expect_response': expect_response,
'meta': meta,
Expand Down
6 changes: 3 additions & 3 deletions ovos_workshop/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# START_VERSION_BLOCK
VERSION_MAJOR = 1
VERSION_MAJOR = 2
VERSION_MINOR = 0
VERSION_BUILD = 3
VERSION_ALPHA = 0
VERSION_BUILD = 0
VERSION_ALPHA = 1
# END_VERSION_BLOCK

0 comments on commit 81ab3ae

Please sign in to comment.