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.
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.