From 6ab76696f160a18a606c9aa46a5b338a3db3e7a0 Mon Sep 17 00:00:00 2001 From: Daniel McKnight <34697904+NeonDaniel@users.noreply.github.com> Date: Fri, 17 Nov 2023 16:08:58 -0800 Subject: [PATCH 1/8] Skill initial implementation (#1) * Skill initial implementation * Update skill.json * Add test dependencies * Update test * Use `add_event` instead of `bus.on` * Testing neon-minerva compat. patch * Update neon-minerva dependency --------- Co-authored-by: Daniel McKnight Co-authored-by: NeonDaniel --- .github/workflows/license_tests.yml | 7 ++ .github/workflows/propose_release.yml | 27 +++++ .github/workflows/publish_release.yml | 12 +++ .github/workflows/publish_test_build.yml | 17 +++ .github/workflows/push_skill_json.yml | 13 +++ .github/workflows/skill_tests.yml | 20 ++++ .github/workflows/update_skill_json.yml | 9 ++ LICENSE.md | 21 ++++ README.md | 30 ++++++ __init__.py | 85 +++++++++++++++ .../dialog/confirm_no_speak_ready.dialog | 1 + .../en-us/dialog/confirm_speak_ready.dialog | 1 + locale/en-us/dialog/ready.dialog | 1 + .../intent/disable_ready_notification.intent | 1 + .../intent/enable_ready_notification.intent | 1 + requirements.txt | 4 + requirements/test.txt | 1 + settingsmeta.yml | 8 ++ setup.py | 102 ++++++++++++++++++ skill.json | 50 +++++++++ test/test_intents.yaml | 9 ++ test/test_resources.yaml | 22 ++++ test/test_skill.py | 50 +++++++++ version.py | 29 +++++ 24 files changed, 521 insertions(+) create mode 100644 .github/workflows/license_tests.yml create mode 100644 .github/workflows/propose_release.yml create mode 100644 .github/workflows/publish_release.yml create mode 100644 .github/workflows/publish_test_build.yml create mode 100644 .github/workflows/push_skill_json.yml create mode 100644 .github/workflows/skill_tests.yml create mode 100644 .github/workflows/update_skill_json.yml create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 __init__.py create mode 100644 locale/en-us/dialog/confirm_no_speak_ready.dialog create mode 100644 locale/en-us/dialog/confirm_speak_ready.dialog create mode 100644 locale/en-us/dialog/ready.dialog create mode 100644 locale/en-us/intent/disable_ready_notification.intent create mode 100644 locale/en-us/intent/enable_ready_notification.intent create mode 100644 requirements.txt create mode 100644 requirements/test.txt create mode 100644 settingsmeta.yml create mode 100644 setup.py create mode 100644 skill.json create mode 100644 test/test_intents.yaml create mode 100644 test/test_resources.yaml create mode 100644 test/test_skill.py create mode 100644 version.py diff --git a/.github/workflows/license_tests.yml b/.github/workflows/license_tests.yml new file mode 100644 index 0000000..4af3f07 --- /dev/null +++ b/.github/workflows/license_tests.yml @@ -0,0 +1,7 @@ +name: Run License Tests +on: + workflow_dispatch: + pull_request: +jobs: + license_tests: + uses: neongeckocom/.github/.github/workflows/license_tests.yml@master diff --git a/.github/workflows/propose_release.yml b/.github/workflows/propose_release.yml new file mode 100644 index 0000000..81dfe43 --- /dev/null +++ b/.github/workflows/propose_release.yml @@ -0,0 +1,27 @@ +name: Propose Stable Release +on: + workflow_dispatch: + inputs: + release_type: + type: choice + description: Release Type + options: + - patch + - minor + - major +jobs: + update_version: + uses: neongeckocom/.github/.github/workflows/propose_semver_release.yml@master + with: + branch: dev + release_type: ${{ inputs.release_type }} + update_changelog: True + pull_changes: + uses: neongeckocom/.github/.github/workflows/pull_master.yml@master + needs: update_version + with: + pr_reviewer: neonreviewers + pr_assignee: ${{ github.actor }} + pr_draft: false + pr_title: ${{ needs.update_version.outputs.version }} + pr_body: ${{ needs.update_version.outputs.changelog }} \ No newline at end of file diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml new file mode 100644 index 0000000..e4b3fa3 --- /dev/null +++ b/.github/workflows/publish_release.yml @@ -0,0 +1,12 @@ +# This workflow will generate a release distribution and upload it to PyPI + +name: Publish Build and GitHub Release +on: + push: + branches: + - master + +jobs: + build_and_publish_pypi_and_release: + uses: neongeckocom/.github/.github/workflows/publish_stable_release.yml@master + secrets: inherit diff --git a/.github/workflows/publish_test_build.yml b/.github/workflows/publish_test_build.yml new file mode 100644 index 0000000..48d6f0e --- /dev/null +++ b/.github/workflows/publish_test_build.yml @@ -0,0 +1,17 @@ +# This workflow will generate a distribution and upload it to PyPI + +name: Publish Alpha Build +on: + push: + branches: + - dev + paths-ignore: + - 'version.py' + +jobs: + build_and_publish_pypi: + uses: neongeckocom/.github/.github/workflows/publish_alpha_release.yml@master + secrets: inherit + with: + version_file: "version.py" + publish_prerelease: true diff --git a/.github/workflows/push_skill_json.yml b/.github/workflows/push_skill_json.yml new file mode 100644 index 0000000..51513e8 --- /dev/null +++ b/.github/workflows/push_skill_json.yml @@ -0,0 +1,13 @@ +# Update skill.json at neon_skills repository +name: Update neon_skills +on: + workflow_dispatch: + push: + branches: + - dev + - master + +jobs: + push_skill_json: + uses: neongeckocom/.github/.github/workflows/skill_update_meta_repo.yml@master + secrets: inherit diff --git a/.github/workflows/skill_tests.yml b/.github/workflows/skill_tests.yml new file mode 100644 index 0000000..7fad329 --- /dev/null +++ b/.github/workflows/skill_tests.yml @@ -0,0 +1,20 @@ +# This workflow will run unit tests + +name: Test Skill +on: + pull_request: + workflow_dispatch: + +jobs: + py_build_tests: + uses: neongeckocom/.github/.github/workflows/python_build_tests.yml@master + skill_unit_tests: + uses: neongeckocom/.github/.github/workflows/skill_tests.yml@master + skill_intent_tests: + uses: neongeckocom/.github/.github/workflows/skill_test_intents.yml@master + skill_resource_tests: + uses: neongeckocom/.github/.github/workflows/skill_test_resources.yml@master + skill_install_tests: + uses: neongeckocom/.github/.github/workflows/skill_test_installation.yml@master + with: + test_osm: false \ No newline at end of file diff --git a/.github/workflows/update_skill_json.yml b/.github/workflows/update_skill_json.yml new file mode 100644 index 0000000..b2c8b93 --- /dev/null +++ b/.github/workflows/update_skill_json.yml @@ -0,0 +1,9 @@ +# This workflow will run unit tests + +name: Update skill.json +on: + push: + +jobs: + update_skill_json: + uses: neongeckocom/.github/.github/workflows/skill_update_json_spec.yml@master diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..525bb37 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +# NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System +# All trademark and other rights reserved by their respective owners +# Copyright 2008-2021 Neongecko.com Inc. +# BSD-3 License + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +following conditions are met: +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following +disclaimer in the documentation and/or other materials provided with the distribution. +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products +derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..cecb85e --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# Ready + +## Summary + +Skill to speak when Neon is ready + +## Description + +When Neon is started or restarted, this skill will speak a notification to the +user. This speech can be enabled/disabled by intent. + +## Examples + +- "Enable ready notifications." +- "Disable load speech." + +## Contact Support + +Use the [link](https://neongecko.com/ContactUs) or [submit an issue on GitHub](https://help.github.com/en/articles/creating-an-issue) + +## Credits +[NeonDaniel](https://github.com/NeonDaniel) +[NeonGeckoCom](https://github.com/NeonGeckoCom) + +## Category +**Daily** + +## Tags +#NeonGecko Original +#NeonAI diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..66537db --- /dev/null +++ b/__init__.py @@ -0,0 +1,85 @@ +# NEON AI (TM) SOFTWARE, Software Development Kit & Application Framework +# All trademark and other rights reserved by their respective owners +# Copyright 2008-2022 Neongecko.com Inc. +# Contributors: Daniel McKnight, Guy Daniels, Elon Gasper, Richard Leeds, +# Regina Bloomstine, Casimiro Ferreira, Andrii Pernatii, Kirill Hrymailo +# BSD-3 License +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from ovos_bus_client import Message +from ovos_utils import classproperty +from ovos_utils.log import LOG +from ovos_utils.process_utils import RuntimeRequirements +from neon_utils.skills import NeonSkill +from ovos_workshop import intent_handler + + +class CoreReadySkill(NeonSkill): + def __init__(self, **kwargs): + NeonSkill.__init__(self, **kwargs) + self.add_event("mycroft.ready", self.handle_ready) + + @classproperty + def runtime_requirements(self): + return RuntimeRequirements(network_before_load=False, + internet_before_load=False, + gui_before_load=False, + requires_internet=False, + requires_network=False, + requires_gui=False, + no_internet_fallback=True, + no_network_fallback=True, + no_gui_fallback=True) + + @property + def speak_ready(self): + """ + Speak `ready` dialog when ready unless disabled in settings + """ + return self.settings.get("speak_ready") is not False + + def handle_ready(self, _: Message): + """ + Handle mycroft.ready event. Notify the user everything is ready if + configured. + """ + if self.speak_ready: + self.speak_dialog("ready") + else: + LOG.info("Ready notification disabled in settings") + + @intent_handler("enable_ready_notification.intent") + def handle_enable_notification(self, _: Message): + """ + Handle a request to enable ready announcements + """ + self.settings["speak_ready"] = True + self.speak_dialog("confirm_speak_ready") + + @intent_handler("disable_ready_notification.intent") + def handle_disable_notification(self, _: Message): + """ + Handle a request to disable ready announcements + """ + self.settings["speak_ready"] = False + self.speak_dialog("confirm_no_speak_ready") diff --git a/locale/en-us/dialog/confirm_no_speak_ready.dialog b/locale/en-us/dialog/confirm_no_speak_ready.dialog new file mode 100644 index 0000000..f8bf3a0 --- /dev/null +++ b/locale/en-us/dialog/confirm_no_speak_ready.dialog @@ -0,0 +1 @@ +Okay. I will stop notifying you when I am ready. \ No newline at end of file diff --git a/locale/en-us/dialog/confirm_speak_ready.dialog b/locale/en-us/dialog/confirm_speak_ready.dialog new file mode 100644 index 0000000..5b9d46d --- /dev/null +++ b/locale/en-us/dialog/confirm_speak_ready.dialog @@ -0,0 +1 @@ +Okay. I will tell you when I am ready after restarts. \ No newline at end of file diff --git a/locale/en-us/dialog/ready.dialog b/locale/en-us/dialog/ready.dialog new file mode 100644 index 0000000..e501bba --- /dev/null +++ b/locale/en-us/dialog/ready.dialog @@ -0,0 +1 @@ +Neon AI is ready. \ No newline at end of file diff --git a/locale/en-us/intent/disable_ready_notification.intent b/locale/en-us/intent/disable_ready_notification.intent new file mode 100644 index 0000000..6bcbeac --- /dev/null +++ b/locale/en-us/intent/disable_ready_notification.intent @@ -0,0 +1 @@ +(disable|turn off|deactivate) (ready|start|boot|load|readiness|started|booted|loaded) (sound|notification|speech|sounds|notifications) \ No newline at end of file diff --git a/locale/en-us/intent/enable_ready_notification.intent b/locale/en-us/intent/enable_ready_notification.intent new file mode 100644 index 0000000..5a0e1eb --- /dev/null +++ b/locale/en-us/intent/enable_ready_notification.intent @@ -0,0 +1 @@ +(enable|turn on|activate) (ready|start|boot|load|readiness|started|startup|booted|loaded) (sound|notification|speech|sounds|notifications) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5841fbe --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +neon-utils~=1.2 +ovos-workshop~=0.0.12 +ovos-utils~=0.0.28 +ovos-bus-client~=0.0.3 \ No newline at end of file diff --git a/requirements/test.txt b/requirements/test.txt new file mode 100644 index 0000000..7f43bf2 --- /dev/null +++ b/requirements/test.txt @@ -0,0 +1 @@ +neon-minerva>=0.0.2a2 \ No newline at end of file diff --git a/settingsmeta.yml b/settingsmeta.yml new file mode 100644 index 0000000..bc05ab2 --- /dev/null +++ b/settingsmeta.yml @@ -0,0 +1,8 @@ +skillMetadata: + sections: + - name: Ready Notification + fields: + - name: speak_ready + type: checkbox + label: Speak when everything is ready after booting + value: "true" \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..b8f6f8b --- /dev/null +++ b/setup.py @@ -0,0 +1,102 @@ +# NEON AI (TM) SOFTWARE, Software Development Kit & Application Framework +# All trademark and other rights reserved by their respective owners +# Copyright 2008-2022 Neongecko.com Inc. +# Contributors: Daniel McKnight, Guy Daniels, Elon Gasper, Richard Leeds, +# Regina Bloomstine, Casimiro Ferreira, Andrii Pernatii, Kirill Hrymailo +# BSD-3 License +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from setuptools import setup +from os import getenv, path, walk + +SKILL_NAME = "skill-core_ready" +SKILL_PKG = SKILL_NAME.replace('-', '_') +# skill_id=package_name:SkillClass +PLUGIN_ENTRY_POINT = f'{SKILL_NAME}.neongeckocom={SKILL_PKG}:CoreReadySkill' +BASE_PATH = path.abspath(path.dirname(__file__)) + + +def get_requirements(requirements_filename: str): + requirements_file = path.join(BASE_PATH, requirements_filename) + with open(requirements_file, 'r', encoding='utf-8') as r: + requirements = r.readlines() + requirements = [r.strip() for r in requirements if r.strip() + and not r.strip().startswith("#")] + + for i in range(0, len(requirements)): + r = requirements[i] + if "@" in r: + parts = [p.lower() if p.strip().startswith("git+http") else p + for p in r.split('@')] + r = "@".join(parts) + if getenv("GITHUB_TOKEN"): + if "github.com" in r: + requirements[i] = \ + r.replace("github.com", + f"{getenv('GITHUB_TOKEN')}@github.com") + return requirements + + +def find_resource_files(): + resource_base_dirs = ("locale", "ui", "vocab", "dialog", "regex") + base_dir = BASE_PATH + package_data = ["skill.json"] + for res in resource_base_dirs: + if path.isdir(path.join(base_dir, res)): + for (directory, _, files) in walk(path.join(base_dir, res)): + if files: + package_data.append( + path.join(directory.replace(base_dir, "").lstrip('/'), + '*')) +# print(package_data) + return package_data + + +with open(path.join(BASE_PATH, "README.md"), "r") as f: + long_description = f.read() + +with open(path.join(BASE_PATH, "version.py"), "r", encoding="utf-8") as v: + for line in v.readlines(): + if line.startswith("__version__"): + if '"' in line: + version = line.split('"')[1] + else: + version = line.split("'")[1] + +setup( + name=f"neon-{SKILL_NAME}", + version=version, + url=f'https://github.com/NeonGeckoCom/{SKILL_NAME}', + license='BSD-3-Clause', + install_requires=get_requirements("requirements.txt"), + extras_require={"test": get_requirements("requirements/test.txt")}, + author='Neongecko', + author_email='developers@neon.ai', + long_description=long_description, + long_description_content_type="text/markdown", + package_dir={SKILL_PKG: ""}, + packages=[SKILL_PKG], + package_data={SKILL_PKG: find_resource_files()}, + include_package_data=True, + entry_points={"ovos.plugin.skill": PLUGIN_ENTRY_POINT} +) diff --git a/skill.json b/skill.json new file mode 100644 index 0000000..44fc5c2 --- /dev/null +++ b/skill.json @@ -0,0 +1,50 @@ +{ + "title": "Ready", + "url": "https://github.com/NeonGeckoCom/skill-core_ready", + "summary": "Skill to speak when Neon is ready", + "short_description": "Skill to speak when Neon is ready", + "description": "When Neon is started or restarted, this skill will speak a notification to the user. This speech can be enabled/disabled by intent.", + "examples": [ + "Enable ready notifications.", + "Disable load speech." + ], + "desktopFile": false, + "warning": "", + "systemDeps": false, + "requirements": { + "python": [ + "neon-utils~=1.2", + "ovos-bus-client~=0.0.3", + "ovos-utils~=0.0.28", + "ovos-workshop~=0.0.12" + ], + "system": {}, + "skill": [] + }, + "incompatible_skills": [], + "platforms": [ + "i386", + "x86_64", + "ia64", + "arm64", + "arm" + ], + "branch": "master", + "license": "BSD-3-Clause", + "icon": "https://0000.us/klatchat/app/files/neon_images/icons/neon_skill.png", + "category": "Daily", + "categories": [ + "Daily" + ], + "tags": [ + "NeonGecko Original", + "NeonAI" + ], + "credits": [ + "NeonDaniel", + "NeonGeckoCom" + ], + "skillname": "skill-core_ready", + "authorname": "NeonGeckoCom", + "foldername": null +} \ No newline at end of file diff --git a/test/test_intents.yaml b/test/test_intents.yaml new file mode 100644 index 0000000..7c2c111 --- /dev/null +++ b/test/test_intents.yaml @@ -0,0 +1,9 @@ +en-us: + enable_ready_notification.intent: + - enable ready notifications + - turn on boot notification + - activate started speech + disable_ready_notification.intent: + - disable readiness sounds + - turn off load sound + - deactivate start speech diff --git a/test/test_resources.yaml b/test/test_resources.yaml new file mode 100644 index 0000000..c484be3 --- /dev/null +++ b/test/test_resources.yaml @@ -0,0 +1,22 @@ +# Specify resources to test here. + +# Specify languages to be tested +languages: + - "en-us" + +# vocab is lowercase .voc file basenames +vocab: [] + +# dialog is .dialog file basenames (case-sensitive) +dialog: + - confirm_no_speak_ready + - confirm_speak_ready +# regex entities, not necessarily filenames +regex: [] +intents: + # Padatious intents are the `.intent` file names + padatious: + - enable_ready_notification.intent + - disable_ready_notification.intent + # Adapt intents are the name passed to the constructor + adapt: [] diff --git a/test/test_skill.py b/test/test_skill.py new file mode 100644 index 0000000..231ed44 --- /dev/null +++ b/test/test_skill.py @@ -0,0 +1,50 @@ +# NEON AI (TM) SOFTWARE, Software Development Kit & Application Framework +# All trademark and other rights reserved by their respective owners +# Copyright 2008-2022 Neongecko.com Inc. +# Contributors: Daniel McKnight, Guy Daniels, Elon Gasper, Richard Leeds, +# Regina Bloomstine, Casimiro Ferreira, Andrii Pernatii, Kirill Hrymailo +# BSD-3 License +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from ovos_bus_client import Message +from neon_minerva.tests.skill_unit_test_base import SkillTestCase + + +class TestSkill(SkillTestCase): + def test_skill_init(self): + self.assertGreaterEqual( + len(self.skill.bus.ee.listeners("mycroft.ready")), 1) + self.assertTrue(self.skill.speak_ready) + + def test_handle_enable_notification(self): + self.skill.settings['speak_ready'] = False + self.skill.handle_enable_notification(Message("")) + self.assertTrue(self.skill.speak_ready) + self.skill.speak_dialog.assert_called_once_with("confirm_speak_ready") + + def test_handle_disable_notification(self): + self.skill.settings['speak_ready'] = True + self.skill.handle_disable_notification(Message("")) + self.assertFalse(self.skill.speak_ready) + self.skill.speak_dialog.assert_called_once_with( + "confirm_no_speak_ready") diff --git a/version.py b/version.py new file mode 100644 index 0000000..3d53a58 --- /dev/null +++ b/version.py @@ -0,0 +1,29 @@ +# NEON AI (TM) SOFTWARE, Software Development Kit & Application Framework +# All trademark and other rights reserved by their respective owners +# Copyright 2008-2022 Neongecko.com Inc. +# Contributors: Daniel McKnight, Guy Daniels, Elon Gasper, Richard Leeds, +# Regina Bloomstine, Casimiro Ferreira, Andrii Pernatii, Kirill Hrymailo +# BSD-3 License +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +__version__ = "0.0.1a0" From 93c1d7108b83273eb4b1e166ae38099ca2d327f9 Mon Sep 17 00:00:00 2001 From: NeonDaniel Date: Sat, 18 Nov 2023 00:09:12 +0000 Subject: [PATCH 2/8] Increment Version to 0.0.1a1 --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index 3d53a58..e47fc1c 100644 --- a/version.py +++ b/version.py @@ -26,4 +26,4 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -__version__ = "0.0.1a0" +__version__ = "0.0.1a1" From 320c957bcc7c9e9a0a3eb051e2266d887712a8a1 Mon Sep 17 00:00:00 2001 From: Daniel McKnight <34697904+NeonDaniel@users.noreply.github.com> Date: Mon, 27 Nov 2023 14:56:40 -0800 Subject: [PATCH 3/8] Add more phrasing to intents with updated tests (#2) Co-authored-by: Daniel McKnight --- locale/en-us/intent/disable_ready_notification.intent | 2 +- locale/en-us/intent/enable_ready_notification.intent | 2 +- test/test_intents.yaml | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/locale/en-us/intent/disable_ready_notification.intent b/locale/en-us/intent/disable_ready_notification.intent index 6bcbeac..58a0e9f 100644 --- a/locale/en-us/intent/disable_ready_notification.intent +++ b/locale/en-us/intent/disable_ready_notification.intent @@ -1 +1 @@ -(disable|turn off|deactivate) (ready|start|boot|load|readiness|started|booted|loaded) (sound|notification|speech|sounds|notifications) \ No newline at end of file +(disable|turn off|deactivate) (ready|start|startup|start up|boot|load|readiness|started|booted|loaded) (sound|notification|speech|sounds|notifications) \ No newline at end of file diff --git a/locale/en-us/intent/enable_ready_notification.intent b/locale/en-us/intent/enable_ready_notification.intent index 5a0e1eb..c0ab19f 100644 --- a/locale/en-us/intent/enable_ready_notification.intent +++ b/locale/en-us/intent/enable_ready_notification.intent @@ -1 +1 @@ -(enable|turn on|activate) (ready|start|boot|load|readiness|started|startup|booted|loaded) (sound|notification|speech|sounds|notifications) \ No newline at end of file +(enable|turn on|activate) (ready|start|startup|start up|boot|load|readiness|started|startup|booted|loaded) (sound|notification|speech|sounds|notifications) \ No newline at end of file diff --git a/test/test_intents.yaml b/test/test_intents.yaml index 7c2c111..b3c0de3 100644 --- a/test/test_intents.yaml +++ b/test/test_intents.yaml @@ -3,7 +3,9 @@ en-us: - enable ready notifications - turn on boot notification - activate started speech + - enable start up notifications disable_ready_notification.intent: - disable readiness sounds - turn off load sound - deactivate start speech + - disable startup notification \ No newline at end of file From 4321d447ec8d8a49f04ca04fbedb5509fd50f8ef Mon Sep 17 00:00:00 2001 From: NeonDaniel Date: Mon, 27 Nov 2023 22:56:57 +0000 Subject: [PATCH 4/8] Increment Version to 0.0.1a2 --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index e47fc1c..cc11eeb 100644 --- a/version.py +++ b/version.py @@ -26,4 +26,4 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -__version__ = "0.0.1a1" +__version__ = "0.0.1a2" From 619768d488f76fdcad3175cc186c4cbdea5eb51b Mon Sep 17 00:00:00 2001 From: Daniel McKnight <34697904+NeonDaniel@users.noreply.github.com> Date: Fri, 15 Dec 2023 17:20:55 -0800 Subject: [PATCH 5/8] Update test dependency (#3) Co-authored-by: Daniel McKnight --- requirements/test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/test.txt b/requirements/test.txt index 7f43bf2..42c48e0 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1 +1 @@ -neon-minerva>=0.0.2a2 \ No newline at end of file +neon-minerva[padatious]~=0.1 \ No newline at end of file From 0ebf984da13fd1781c6518b9a019a6655017c8b3 Mon Sep 17 00:00:00 2001 From: NeonDaniel Date: Sat, 16 Dec 2023 01:21:11 +0000 Subject: [PATCH 6/8] Increment Version to 0.0.1a3 --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index cc11eeb..caf633f 100644 --- a/version.py +++ b/version.py @@ -26,4 +26,4 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -__version__ = "0.0.1a2" +__version__ = "0.0.1a3" From 975b03aad521959aff07883a35e12c78d4aedeaf Mon Sep 17 00:00:00 2001 From: NeonDaniel Date: Sat, 16 Dec 2023 01:25:39 +0000 Subject: [PATCH 7/8] Increment Version to 0.0.1 --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index caf633f..ef7228e 100644 --- a/version.py +++ b/version.py @@ -26,4 +26,4 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -__version__ = "0.0.1a3" +__version__ = "0.0.1" From 0672a84ab61fa782df124718bf3745a749b7e4d9 Mon Sep 17 00:00:00 2001 From: NeonDaniel Date: Sat, 16 Dec 2023 01:26:00 +0000 Subject: [PATCH 8/8] Update Changelog --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..7f0ee26 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,29 @@ +# Changelog + +## [0.0.1a3](https://github.com/NeonGeckoCom/skill-core_ready/tree/0.0.1a3) (2023-12-16) + +[Full Changelog](https://github.com/NeonGeckoCom/skill-core_ready/compare/0.0.1a2...0.0.1a3) + +**Merged pull requests:** + +- Update test dependency [\#3](https://github.com/NeonGeckoCom/skill-core_ready/pull/3) ([NeonDaniel](https://github.com/NeonDaniel)) + +## [0.0.1a2](https://github.com/NeonGeckoCom/skill-core_ready/tree/0.0.1a2) (2023-11-27) + +[Full Changelog](https://github.com/NeonGeckoCom/skill-core_ready/compare/0.0.1a1...0.0.1a2) + +**Merged pull requests:** + +- Add more phrasing to intents with updated tests [\#2](https://github.com/NeonGeckoCom/skill-core_ready/pull/2) ([NeonDaniel](https://github.com/NeonDaniel)) + +## [0.0.1a1](https://github.com/NeonGeckoCom/skill-core_ready/tree/0.0.1a1) (2023-11-18) + +[Full Changelog](https://github.com/NeonGeckoCom/skill-core_ready/compare/6c2a65ef396bee4c9614b1e7ed4e7d5305b2b87b...0.0.1a1) + +**Merged pull requests:** + +- Skill initial implementation [\#1](https://github.com/NeonGeckoCom/skill-core_ready/pull/1) ([NeonDaniel](https://github.com/NeonDaniel)) + + + +\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*