-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHAL #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted missing/incorrect documentation
from ovos_utils.messagebus import get_mycroft_bus | ||
|
||
|
||
class PHALPlugin: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider just PHAL
to match TTS
, STT
, etc.
self.bus.on("enclosure.reset", self.on_reset) | ||
|
||
# enclosure commands for Mycroft's Hardware. | ||
self.bus.on("enclosure.system.reset", self.on_system_reset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be cleaner to define the events/handlers as tuples in a param or property and iterate over that list since these are duplicated in start/stop methods. This also lets an extending class add handlers without having to add in the self.bus.on/off
calls
|
||
# Audio Events | ||
def on_record_begin(self, message=None): | ||
''' listening started ''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider updating '''
to """
in docstrings for consistency
def on_no_internet(self, message=None): | ||
""" | ||
|
||
Args: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should either be added to all handlers or removed from this one
def on_system_blink(self, message=None): | ||
"""The 'eyes' should blink the given number of times. | ||
Args: | ||
times (int): number of times to blink |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
args don't match signature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in all these args they are documenting what comes inside the message.data , they are not final and were copied over from original methods that emitted the message
as you can probably tell i copied over almost every defined event handler for enclosure in mycroft-core
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah; figured it was copy/paste.. Maybe we should define some standard way to document expected data/context in these docstrings?
def _on_mouth_text(self, message=None): | ||
"""Display text (scrolling as needed) | ||
Args: | ||
text (str): text string to display |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
args don't match signature
self.on_text(message) | ||
|
||
def _on_mouth_display(self, message=None): | ||
if self.mouth_events_active: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing docstring
def on_viseme(self, message=None): | ||
"""Display a viseme mouth shape for synched speech | ||
Args: | ||
code (int): 0 = shape for sounds like 'y' or 'aa' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
args don't match signature
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
args don't match signature
"""Show a the temperature and a weather icon | ||
|
||
Args: | ||
img_code (char): one of the following icon codes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
args don't match signature
this PR is pending on the actual release of PHAL and may still change significantly, marking as draft while base class is ironed out but keep the feedback coming! |
this goes together with OpenVoiceOS/ovos-utils#11 what used to be the enclosure template in ovos utils is now the PHAL plugin |
early merging to allow PHAL release 0.0.1 will refactor later |
this goes together with OpenVoiceOS/ovos-utils#11
what used to be the enclosure template in ovos utils is now the PHAL plugin