Common Play Framework
To support a range of Skills that can "play" things, each Common Play Skill must return a confidence score to indicate their ability to successfully complete the users request.
Introduction
Basing your Skill on the CommonPlaySkill class instead of MycroftSkill
CommonPlaySkill class instead of MycroftSkillfrom mycroft.skills.common_play_skill import CommonPlaySkill, CPSMatchLevel
class TutorialSkill(CommonPlaySkill):
def CPS_match_query_phrase(self, phrase):
""" This method responds wether the skill can play the input phrase.
The method is invoked by the PlayBackControlSkill.
Returns: tuple (matched phrase(str),
match level(CPSMatchLevel),
optional data(dict))
or None if no match was found.
"""
return None
def CPS_start(self, phrase, data):
""" Starts playback.
Called by the playback control skill to start playback if the
skill is selected (has the best match level)
"""
pass
def create_skill():
return TutorialSkill()CPS_match_query_phrase
CPS_start
Example implementation of CommonPlaySkill
CommonPlaySkillTechnical Documentation
Where to go for more assistance
Last updated
Was this helpful?