Public Member Functions | Private Member Functions | List of all members
mycroft.skills.common_iot_skill.CommonIoTSkill Class Reference
Inheritance diagram for mycroft.skills.common_iot_skill.CommonIoTSkill:
Inheritance graph
[legend]

Public Member Functions

def bind (self, bus)
 
def can_handle
 
def get_entities (self)
 
def get_scenes (self)
 
def register_entities_and_scenes (self)
 
def run_request
 
def supported_request_version (self)
 

Private Member Functions

def _handle_call_for_registration
 
def _handle_trigger
 
def _register_words
 
def _run_request
 

Detailed Description

Skills that want to work with the CommonIoT system should
extend this class. Subclasses will be expected to implement
two methods, `can_handle` and `run_request`. See the
documentation for those functions for more details on how
they are expected to behave.

Subclasses may also register their own entities and scenes.
See the register_entities and register_scenes methods for
details.

This class works in conjunction with a controller skill.
The controller registers vocabulary and intents to capture
IoT related requests. It then emits messages on the messagebus
that will be picked up by all skills that extend this class.
Each skill will have the opportunity to declare whether or not
it can handle the given request. Skills that acknowledge that
they are capable of handling the request will be considered
candidates, and after a short timeout, a winner, or winners,
will be chosen. With this setup, a user can have several IoT
systems, and control them all without worry that skills will
step on each other.

Definition at line 248 of file common_iot_skill.py.

Member Function Documentation

def mycroft.skills.common_iot_skill.CommonIoTSkill._handle_call_for_registration (   self,
  _ 
)
private

Definition at line 324 of file common_iot_skill.py.

def mycroft.skills.common_iot_skill.CommonIoTSkill._handle_trigger (   self,
  message 
)
private

Definition at line 290 of file common_iot_skill.py.

def mycroft.skills.common_iot_skill.CommonIoTSkill._register_words (   self,
  words 
)
private

Definition at line 333 of file common_iot_skill.py.

def mycroft.skills.common_iot_skill.CommonIoTSkill._run_request (   self,
  message 
)
private

Definition at line 311 of file common_iot_skill.py.

def mycroft.skills.common_iot_skill.CommonIoTSkill.bind (   self,
  bus 
)
Overrides MycroftSkill.bind.

This is called automatically during setup, and
need not otherwise be used.

Args:
    bus:

Definition at line 273 of file common_iot_skill.py.

def mycroft.skills.common_iot_skill.CommonIoTSkill.can_handle (   self,
  request 
)

Definition at line 410 of file common_iot_skill.py.

def mycroft.skills.common_iot_skill.CommonIoTSkill.get_entities (   self,
  str 
)
Get a list of custom entities.

This is intended to be overridden by subclasses, though it
it not required (the default implementation will return an
empty list).

The strings returned by this function will be registered
as ENTITY values with the intent parser. Skills should provide
group names, user aliases for specific devices, or anything
else that might represent a THING or a set of THINGs, e.g.
'bedroom', 'lamp', 'front door.' This allows commands that
don't explicitly include a THING to still be handled, e.g.
"bedroom off" as opposed to "bedroom lights off."

Definition at line 379 of file common_iot_skill.py.

def mycroft.skills.common_iot_skill.CommonIoTSkill.get_scenes (   self,
  str 
)
Get a list of custom scenes.

This method is intended to be overridden by subclasses, though
it is not required. The strings returned by this function will
be registered as SCENE values with the intent parser. Skills
should provide user defined scene names that they are aware of
and capable of handling, e.g. "relax," "movie time," etc.

Definition at line 397 of file common_iot_skill.py.

def mycroft.skills.common_iot_skill.CommonIoTSkill.register_entities_and_scenes (   self)
This method will register this skill's scenes and entities.

This should be called in the skill's `initialize` method,
at some point after `get_entities` and `get_scenes` can
be expected to return correct results.

Definition at line 352 of file common_iot_skill.py.

def mycroft.skills.common_iot_skill.CommonIoTSkill.run_request (   self,
  request 
)

Definition at line 439 of file common_iot_skill.py.

def mycroft.skills.common_iot_skill.CommonIoTSkill.supported_request_version (   self,
  IoTRequestVersion 
)
Get the supported IoTRequestVersion

By default, this returns IoTRequestVersion.V1. Subclasses
should override this to indicate higher levels of support.

The documentation for IoTRequestVersion provides a reference
indicating which fields are included in each version. Note
that you should always take the latest, and account for all
request fields.

Definition at line 365 of file common_iot_skill.py.


The documentation for this class was generated from the following file:


mycroft_ros
Author(s):
autogenerated on Mon Apr 26 2021 02:35:40