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

Deprecate create_skill method and Update __init__ for best practices #40

Merged
merged 2 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/workflows/skill_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ jobs:
# 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
12 changes: 4 additions & 8 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@
from neon_utils.message_utils import get_message_user


class UsbCamSkill(NeonSkill):

def __init__(self):
super(UsbCamSkill, self).__init__(name="Camera")
class CameraSkill(NeonSkill):
def __init__(self, **kwargs):
NeonSkill.__init__(self, **kwargs)
self.pic_path = os.path.expanduser("~/Pictures/Neon")
self.vid_path = os.path.expanduser("~/Videos/Neon")
os.makedirs(self.pic_path, exist_ok=True)
Expand Down Expand Up @@ -92,6 +91,7 @@ def runtime_requirements(self):
no_network_fallback=True,
no_gui_fallback=True)

# TODO: Move to __init__ after stable ovos-workshop
def initialize(self):
# Uses `duration` from mycroft-timer skill
self.register_entity_file('duration.entity')
Expand Down Expand Up @@ -358,7 +358,3 @@ def ensure_dir(file_path):

def stop(self):
self.handle_camera_completed()


def create_skill():
return UsbCamSkill()