Skip to content
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

add notification api change and style parameter #6

Merged
merged 1 commit into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions ovos_utils/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ def remove_pages(self, page_names):

# backport - PR https://github.com/MycroftAI/mycroft-core/pull/2862
def show_notification(self, content, action=None,
noticetype="transient"):
noticetype="transient", style="info"):
"""Display a Notification on homepage in the GUI.
Arguments:
content (str): Main text content of a notification, Limited
Expand All @@ -691,15 +691,21 @@ def show_notification(self, content, action=None,
noticetype (str):
transient: 'Default' displays a notification with a timeout.
sticky: displays a notification that sticks to the screen.
style (str):
info: 'Default' displays a notification with information styling
warning: displays a notification with warning styling
success: displays a notification with success styling
error: displays a notification with error styling
"""
if not self.bus:
raise RuntimeError("bus not set, did you call self.bind() ?")
self.bus.emit(Message("homescreen.notification.set",
self.bus.emit(Message("ovos.notification.api.set",
data={
"sender": self.skill_id,
"text": content,
"action": action,
"type": noticetype
"type": noticetype,
"style": style
}))

def show_text(self, text, title=None, override_idle=None,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='ovos_utils',
version='0.0.12',
version='0.0.13',
packages=['ovos_utils',
'ovos_utils.intents',
'ovos_utils.sound',
Expand Down