Public Member Functions | |
| def | __init__ (self, bus, name="") |
| def | activate_mouth_events (self) |
| def | deactivate_mouth_events (self) |
| def | eyes_blink (self, side) |
| def | eyes_brightness (self, level=30) |
| def | eyes_color (self, r=255, g=255, b=255) |
| def | eyes_fill (self, percentage) |
| def | eyes_look (self, side) |
| def | eyes_narrow (self) |
| def | eyes_off (self) |
| def | eyes_on (self) |
| def | eyes_reset (self) |
| def | eyes_setpixel (self, idx, r=255, g=255, b=255) |
| def | eyes_spin (self) |
| def | eyes_timed_spin (self, length) |
| def | eyes_volume (self, volume) |
| def | mouth_display (self, img_code="", x=0, y=0, refresh=True) |
| def | mouth_display_png (self, image_absolute_path, invert=False, x=0, y=0, refresh=True) |
| def | mouth_listen (self) |
| def | mouth_reset (self) |
| def | mouth_smile (self) |
| def | mouth_talk (self) |
| def | mouth_text (self, text="") |
| def | mouth_think (self) |
| def | mouth_viseme (self, start, viseme_pairs) |
| def | register (self, skill_name="") |
| def | reset (self) |
| def | system_blink (self, times) |
| def | system_mute (self) |
| def | system_reset (self) |
| def | system_unmute (self) |
| def | weather_display (self, img_code, temp) |
Public Attributes | |
| bus | |
| display_manager | |
| name | |
This API is intended to be used to interface with the hardware that is running Mycroft. It exposes all possible commands which can be sent to a Mycroft enclosure implementation. Different enclosure implementations may implement this differently and/or may ignore certain API calls completely. For example, the eyes_color() API might be ignore on a Mycroft that uses simple LEDs which only turn on/off, or not at all on an implementation where there is no face at all.
| def mycroft.enclosure.api.EnclosureAPI.__init__ | ( | self, | |
| bus, | |||
name = "" |
|||
| ) |
| def mycroft.enclosure.api.EnclosureAPI.activate_mouth_events | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.deactivate_mouth_events | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.eyes_blink | ( | self, | |
| side | |||
| ) |
| def mycroft.enclosure.api.EnclosureAPI.eyes_brightness | ( | self, | |
level = 30 |
|||
| ) |
| def mycroft.enclosure.api.EnclosureAPI.eyes_color | ( | self, | |
r = 255, |
|||
g = 255, |
|||
b = 255 |
|||
| ) |
| def mycroft.enclosure.api.EnclosureAPI.eyes_fill | ( | self, | |
| percentage | |||
| ) |
| def mycroft.enclosure.api.EnclosureAPI.eyes_look | ( | self, | |
| side | |||
| ) |
| def mycroft.enclosure.api.EnclosureAPI.eyes_narrow | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.eyes_off | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.eyes_on | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.eyes_reset | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.eyes_setpixel | ( | self, | |
| idx, | |||
r = 255, |
|||
g = 255, |
|||
b = 255 |
|||
| ) |
| def mycroft.enclosure.api.EnclosureAPI.eyes_spin | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.eyes_timed_spin | ( | self, | |
| length | |||
| ) |
| def mycroft.enclosure.api.EnclosureAPI.eyes_volume | ( | self, | |
| volume | |||
| ) |
| def mycroft.enclosure.api.EnclosureAPI.mouth_display | ( | self, | |
img_code = "", |
|||
x = 0, |
|||
y = 0, |
|||
refresh = True |
|||
| ) |
Display images on faceplate. Currently supports images up to 16x8,
or half the face. You can use the 'x' parameter to cover the other
half of the faceplate.
Args:
img_code (str): text string that encodes a black and white image
x (int): x offset for image
y (int): y offset for image
refresh (bool): specify whether to clear the faceplate before
displaying the new image or not.
Useful if you'd like to display multiple images
on the faceplate at once.
| def mycroft.enclosure.api.EnclosureAPI.mouth_display_png | ( | self, | |
| image_absolute_path, | |||
invert = False, |
|||
x = 0, |
|||
y = 0, |
|||
refresh = True |
|||
| ) |
Send an image to the enclosure.
Args:
image_absolute_path (string): The absolute path of the image
invert (bool): inverts the image being drawn.
x (int): x offset for image
y (int): y offset for image
refresh (bool): specify whether to clear the faceplate before
displaying the new image or not.
Useful if you'd like to display muliple images
on the faceplate at once.
| def mycroft.enclosure.api.EnclosureAPI.mouth_listen | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.mouth_reset | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.mouth_smile | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.mouth_talk | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.mouth_text | ( | self, | |
text = "" |
|||
| ) |
| def mycroft.enclosure.api.EnclosureAPI.mouth_think | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.mouth_viseme | ( | self, | |
| start, | |||
| viseme_pairs | |||
| ) |
Send mouth visemes as a list in a single message.
Arguments:
start (int): Timestamp for start of speech
viseme_pairs: Pairs of viseme id and cumulative end times
(code, end time)
codes:
0 = shape for sounds like 'y' or 'aa'
1 = shape for sounds like 'aw'
2 = shape for sounds like 'uh' or 'r'
3 = shape for sounds like 'th' or 'sh'
4 = neutral shape for no sound
5 = shape for sounds like 'f' or 'v'
6 = shape for sounds like 'oy' or 'ao'
| def mycroft.enclosure.api.EnclosureAPI.register | ( | self, | |
skill_name = "" |
|||
| ) |
| def mycroft.enclosure.api.EnclosureAPI.reset | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.system_blink | ( | self, | |
| times | |||
| ) |
| def mycroft.enclosure.api.EnclosureAPI.system_mute | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.system_reset | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.system_unmute | ( | self | ) |
| def mycroft.enclosure.api.EnclosureAPI.weather_display | ( | self, | |
| img_code, | |||
| temp | |||
| ) |