Skip to content
This repository has been archived by the owner on Oct 24, 2021. It is now read-only.

waiting_for_mycroft #15

Merged
merged 2 commits into from
Dec 29, 2020
Merged

waiting_for_mycroft #15

merged 2 commits into from
Dec 29, 2020

Conversation

JarbasAl
Copy link
Member

@JarbasAl JarbasAl commented Dec 27, 2020

closes #7

Fixes

New methods

Mycroft Patches

adds òvos_utils.waiting_for_mycroft which includes monkey patched alternative imports for mycroft-core

MycroftSkill and FallbackSkill patches:

from ovos_utils.waiting_for_mycroft.base_skill import MycroftSkill
from ovos_utils.waiting_for_mycroft.base_skill import FallbackSkill
from ovos_utils.waiting_for_mycroft.skill_api import skill_api_method

class TestSkill(MycroftSkill):
    @skill_api_method
    def speak_meth(self, message):
        """Speak the test sentence."""
        self.speak('This is a test')
 
    @skill_api_method
    def speak_meth2(self, message):
        """Speak another test sentence."""
        self.speak('This is another test')

You can then use this skill from another skill

from ovos_utils.waiting_for_mycroft.skill_api import SkillApi

# get an api object and use that to trigger the skill:
my_skill = SkillApi.get('myskill.forslund')
my_skill.speak_meth()

SkillGUI patches:

  • patch SkillGUI.show_pages to use ovos_utils.resolve_ovos_resource_file
  • patch SkillGUI.remove_pages to use ovos_utils.resolve_ovos_resource_file

Video playback from MycroftAI/mycroft-core#2683

  • add SkillGUI.play_video
  • add SkillGUI.is_video_displayed
  • add SkillGUI.playback_status
  • add SkillGUI.pause_video
  • add SkillGUI.resume_video
  • add SkillGUI.stop_video

Skill settings from MycroftAI/mycroft-core#2698

  • add SkillGUI.register_settings
  • add SkillGUI.show_settings
from ovos_utils.waiting_for_mycroft.skil_gui import SkillGUI

CommonPlaySkill patches:

from ovos_utils.waiting_for_mycroft.common_play import CPSMatchType
from ovos_utils.waiting_for_mycroft.common_play import CommonPlaySkill

@JarbasAl JarbasAl added the enhancement New feature or request label Dec 27, 2020
@ChanceNCounter
Copy link

How does the universal fallback work with auto-translation, is that going to get fed back into the intent parsers?

@JarbasAl
Copy link
Member Author

that was just moved around and otherwise not touched by this PR, it's an old experiment and might require a review in follow up PR

it uses autotranslate in the speak method,and overrides intent register methods to also auto translate utterance, you will get rate limited quickly if abusing this

@JarbasAl JarbasAl force-pushed the waiting_for_mycroft branch 2 times, most recently from e37f4b6 to 30aa182 Compare December 29, 2020 14:46
@JarbasAl
Copy link
Member Author

still want to add MycroftAI/mycroft-core#987

i'm testing all of these in the wild, but is almost merge ready

@JarbasAl
Copy link
Member Author

shamelessly self merging for proper testing in the wild

@JarbasAl JarbasAl changed the title waiting_for_mycroft module waiting_for_mycroft Dec 29, 2020
@JarbasAl JarbasAl merged commit 3f8b809 into dev Dec 29, 2020
@JarbasAl JarbasAl deleted the waiting_for_mycroft branch December 29, 2020 21:40
@ChanceNCounter
Copy link

I have zero complaints in this case, but pip3 install --force git+<>

@JarbasAl
Copy link
Member Author

but i wanna release skills using this, noone will test individual functionality, but maybe ill get issues in the downstream skills, so id rather have it properly packaged :p

I am the only use in the wild of ovos_utils either way 🤷‍♂️

@JarbasAl JarbasAl mentioned this pull request Dec 31, 2020
@JarbasAl JarbasAl added the mycroft_patch a new monkey patch label Dec 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request mycroft_patch a new monkey patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

new module - waiting_for_mycroft
2 participants