Sending notification messages from Python addon
#1
Question 
Does the Python addon API have a way to send notification messages? The only way I've found is to use xbmc.executebuiltin:

Code:
xbmc.executebuiltin("Notification(Title,A notification message)")

It works, but is that the "proper" way to do it?
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
#2
What's wrong with using xbmc.executebuiltin()?
Afaik you can also use xbmc.executeJSONRPC() but the Notification-builtin is needed in any case.

Btw, this method has two more (optional) parameters:
Notification(header,message[,time,image])

regards,
sphere
My GitHub. My Add-ons:
Image
Reply
#3
That or the json api. Nothing improper about it.
Reply
#4
Not improper but it just doesn't seem very Pythonic, in the same way as

Code:
xbmc.restart()

is more Pythonic than

Code:
xbmc.executebuiltin("Reboot")

I wondered why there isn't a xbmcgui.notification() function for the Python API.

Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply
#5
Ahhh, /agreed
Reply
#6
xbmc use messaging internally, which is also used by multiple apis, like skins and the web api. Until recently the python api have been written manually. I guess that's why it's "not very pythonic". At least the api it isn't fragmented..
Reply
#7
You can also have a look to jbel's xbmcswift2 addon framework - I love it. It makes the plugin api much more pythonic Wink

It also has a wrapper for notifications Wink

Have a look to: www.xbmcswift.com

regards,
sphere
My GitHub. My Add-ons:
Image
Reply
#8
I know this thread is over a year old but in case anyone finds it... there is now a Dialog.notification() method.
https://github.com/xbmc/xbmc/pull/2627
Leopold's Repository: Home of LibreELEC Dev Updater ...
Reply

Logout Mark Read Team Forum Stats Members Help
Sending notification messages from Python addon0