Skip to content

Commit

Permalink
modified class
Browse files Browse the repository at this point in the history
  • Loading branch information
mushie4282 committed Mar 9, 2024
1 parent 37a8cf8 commit 6c80f52
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 38 deletions.
9 changes: 7 additions & 2 deletions .projenrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"type": "@mikejgray/ovos-skill-projen.OVOSSkillProject",
"name": "skill-r2arc-text-emergency"
}
"name": "skill-r2arc-text-emergency",
"author": "Michelle T.",
"authorAddress": "[email protected]",
"authorHandle": "mushie4282",
"skillClass": "TextEmergencySkill",
"repositoryUrl": "https://github.com/SeniorDesign-RC-LB/skill-r2arc-text"
}
43 changes: 7 additions & 36 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ovos_utils import classproperty
from ovos_utils.process_utils import RuntimeRequirements
from ovos_workshop.intents import IntentBuilder
from ovos_workshop.decorators import intent_handler
# from ovos_workshop.intents import IntentBuilder
# from ovos_workshop.decorators import intent_handler
# from ovos_workshop.intents import IntentHandler # Uncomment to use Adapt intents
from ovos_workshop.skills import OVOSSkill

Expand All @@ -14,20 +14,14 @@

class TextEmergencySkill(OVOSSkill):
def __init__(self, *args, bus=None, **kwargs):
"""The __init__ method is called when the Skill is first constructed.
Note that self.bus, self.skill_id, self.settings, and
other base class settings are only available after the call to super().
This is a good place to load and pre-process any data needed by your
Skill, ideally after the super() call.
"""
super().__init__(*args, bus=bus, **kwargs)
self.learning = True

def initialize(self):
# merge default settings
# self.settings is a jsondb, which extends the dict class and adds helpers like merge
self.settings.merge(DEFAULT_SETTINGS, new_only=True)
self.add_event('recognizer_loop:hotword', self.handle_text_help)
self.add_event('bus_event', self.handle_text_help)
# add instance of cellular module

@classproperty
def runtime_requirements(self):
Expand All @@ -51,31 +45,8 @@ def my_setting(self):
"""
return self.settings.get("my_setting", "default_value")

@intent_handler("HowAreYou.intent")
def handle_how_are_you_intent(self, message):
"""This is a Padatious intent handler.
It is triggered using a list of sample phrases."""
self.speak_dialog("hello_world")

@intent_handler(IntentBuilder("HelloWorldIntent").require("HelloWorldKeyword"))
def handle_hello_world_intent(self, message):
"""This is an Adapt intent handler, it is triggered by a keyword.
Skills can log useful information. These will appear in the CLI and
the skills.log file."""
self.log.info("There are five types of log messages: " "info, debug, warning, error, and exception.")
self.speak_dialog("hello_world")

@intent_handler(IntentBuilder("RoboticsLawsIntent").require("LawKeyword").build())
def handle_robotic_laws_intent(self, message):
"""This is an Adapt intent handler, but using a RegEx intent."""
# Optionally, get the RegEx group from the intent message
# law = str(message.data.get("LawOfRobotics", "all"))
self.speak_dialog("robotics")
def handle_text_help(self, message):
self.speak("Contacting emergency services right now")

def stop(self):
"""Optional action to take when "stop" is requested by the user.
This method should return True if it stopped something or
False (or None) otherwise.
If not relevant to your skill, feel free to remove.
"""
return

0 comments on commit 6c80f52

Please sign in to comment.