Skip to content

Commit

Permalink
add notification api change and style parameter (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
AIIX committed Nov 9, 2021
1 parent 28badf8 commit e0027b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
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

0 comments on commit e0027b7

Please sign in to comment.