From 6c80f520ddf921085768b997445a5d1e902a91f6 Mon Sep 17 00:00:00 2001 From: mushie4282 Date: Fri, 8 Mar 2024 19:39:07 -0800 Subject: [PATCH] modified class --- .projenrc.json | 9 +++++++-- src/__init__.py | 43 +++++++------------------------------------ 2 files changed, 14 insertions(+), 38 deletions(-) diff --git a/.projenrc.json b/.projenrc.json index d88397a..d360450 100644 --- a/.projenrc.json +++ b/.projenrc.json @@ -1,4 +1,9 @@ { "type": "@mikejgray/ovos-skill-projen.OVOSSkillProject", - "name": "skill-r2arc-text-emergency" -} \ No newline at end of file + "name": "skill-r2arc-text-emergency", + "author": "Michelle T.", + "authorAddress": "michelle.tran02@student.csulb.edu", + "authorHandle": "mushie4282", + "skillClass": "TextEmergencySkill", + "repositoryUrl": "https://github.com/SeniorDesign-RC-LB/skill-r2arc-text" +} diff --git a/src/__init__.py b/src/__init__.py index 8c77943..a9874d7 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -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 @@ -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): @@ -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