__init__method is called when the Skill is first constructed. It is often used to declare variables or perform setup actions, however it cannot utilize other MycroftSkill methods and properties as the class does not yet exist. This includes
self.settingswhich must instead be called from your Skill's
__init__method is optional, but if used, the
__init__method from the Super Class (MycroftSkill) must be called.
True. The variable is appended to the instance using
selfso that we can access this variable in any part of our Skill.
initializemethod is called after the Skill is fully constructed and registered with the system. It is used to perform any final setup for the Skill including accessing Skill settings.
my_settingvalue, that would have been defined in the Skill's
settingsmeta.json. We use the
getmethod in case the variable
conversemethod can be used to handle follow up utterances prior to the normal intent handling process. It can be useful for handling utterances from a User that do not make sense as a standalone intent.
utterances(list): The utterances from the user. If there are multiple utterances, consider them all to be transcription possibilities. Commonly, the first entry is the raw utterance and the second is a
normalizedversion of the first utterance.
lang(string): The language the utterance is in. This defaults to None.
conversemethod will be called each time an utterance is received. It is therefore important to check the contents of the utterance to ensure it matches what you expected.
Trueto indicate that the utterance should not be passed onto the normal intent matching service and no other action is required by the system. If the utterance was not handled, we return
Falseand the utterance is passed on first to other
conversemethods, and then to the normal intent matching service.
understood.voc. If the user has understood we speak a line from
Trueto indicate the utterance has been handled. If the vocabulary does not match then we return
Falseas the utterance should be passed to the normal intent matching service.
stopmethod is called anytime a User says "Stop" or a similar command. It is useful for stopping any output or process that a User might want to end without needing to issue a Skill specific utterance such as media playback or an expired alarm notification.
stop_beepingto end a notification that our Skill has created.
shutdownmethod is called during the Skill process termination. It is used to perform any final actions to ensure all processes and operations in execution are stopped safely. This might be particularly useful for Skills that have scheduled future events, may be writing to a file or database, or that have initiated new processes.