diff --git a/neon_utils/skills/mycroft_skill.py b/neon_utils/skills/mycroft_skill.py index 9f0023ae..4e9c066b 100644 --- a/neon_utils/skills/mycroft_skill.py +++ b/neon_utils/skills/mycroft_skill.py @@ -57,14 +57,6 @@ def __init__(self, name=None, bus=None, *args, **kwargs): self._speak_timeout = 30 self._get_response_timeout = 15 # 10 for listener, 5 for STT, then timeout - @property - def settings_path(self): - # TODO: Deprecate backwards-compat. wrapper after ovos-workshop 0.0.13 - try: - return super().settings_path - except AttributeError: - return super()._settings_path - @property def location(self): """ @@ -90,11 +82,6 @@ def _init_settings(self): json.dump(self.settings, f, indent=4) self._initial_settings = dict(self.settings) - def _init_settings_manager(self): - # TODO: Same as upstream implementation? - from ovos_workshop.settings import SkillSettingsManager - self.settings_manager = SkillSettingsManager(self) - def _read_default_settings(self): yaml_path = os.path.join(self.root_dir, "settingsmeta.yml") json_path = os.path.join(self.root_dir, "settingsmeta.json") diff --git a/neon_utils/skills/neon_skill.py b/neon_utils/skills/neon_skill.py index 93c03828..1054ce4d 100644 --- a/neon_utils/skills/neon_skill.py +++ b/neon_utils/skills/neon_skill.py @@ -106,22 +106,6 @@ def initialize(self): self.schedule_event(self._write_cache_on_disk, CACHE_TIME_OFFSET, name="neon.load_cache_on_disk") - @property - def settings_path(self): - # TODO: Deprecate backwards-compat. wrapper after ovos-workshop 0.0.13 - try: - return super().settings_path - except AttributeError: - return super()._settings_path - - @property - def resources(self): - # TODO: Deprecate backwards-compat. wrapper after ovos-workshop 0.0.13 - try: - return super().resources - except AttributeError: - return super()._resources - @property # @deprecated("Call `dateutil.tz.gettz` directly", "2.0.0") def sys_tz(self): @@ -545,23 +529,24 @@ def _init_settings(self): Extends the default method to handle settingsmeta defaults locally """ from neon_utils.configuration_utils import dict_update_keys - super()._init_settings() - skill_settings = get_local_settings(self.settings_path) - settings_from_disk = dict(skill_settings) - self.settings = dict_update_keys(skill_settings, - self._read_default_settings()) - if self.settings != settings_from_disk: - if isinstance(self.settings, JsonStorage): - self.settings.store() - else: - with open(self.settings_path, "w+") as f: - json.dump(self.settings, f, indent=4) - self._initial_settings = dict(self.settings) - - def _init_settings_manager(self): - # TODO: Same as upstream implementation? - from ovos_workshop.settings import SkillSettingsManager - self.settings_manager = SkillSettingsManager(self) + BaseSkill._init_settings(self) + settings_from_disk = dict(self.settings) + dict_update_keys(self._settings, self._read_default_settings()) + if self._settings != settings_from_disk: + LOG.info("Updated default settings from skill metadata") + self._settings.store() + self._initial_settings = dict(self._settings) + LOG.info(f"Skill initialized with settings: {self.settings}") + + def _handle_converse_request(self, message: Message): + # TODO: Remove patch after ovos-core 0.0.8 + if message.msg_type == "skill.converse.request" and \ + message.data.get('skill_id') != self.skill_id: + # Legacy request not for Neon + return + if message.msg_type == "skill.converse.request": + message.msg_type = "neon.converse.request" + BaseSkill._handle_converse_request(self, message) def _read_default_settings(self): from neon_utils.configuration_utils import parse_skill_default_settings diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 7b7a2675..1dd7d085 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -8,4 +8,4 @@ ovos-lingua-franca~=0.4 ovos_utils~=0.0.35 geopy~=2.1 ovos-config~=0.0.9 -ovos-workshop~=0.0.12 \ No newline at end of file +ovos-workshop~=0.0.15 \ No newline at end of file