Notification keeps changing window to programs library!?
#1
Hi all,

I've made my first kodi addon using python. It simply pulls json data from a website and displays it as a notification.

It's working, except no matter where I run my addon from (custom home menu through skin customisation or settings->addons->) when I run it, it changes the kodi window to the programs library menu, and displays the notification there. I would like the notification to display on the home screen when I run from my customised skin button. I've tried different skins, and different notification methods, and in every case it changes the kodi window to programs library, which you then have to back out of after the notification has finished Sad

Tried notification methods:

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

Code:
dialog = xbmcgui.Dialog()
dialog.notification("header","message",icon, sleepTime)

I'v even tried adding:

Code:
xbmc.executebuiltin("XBMC.ActivateWindow(Home)")

but this doesn't stop the behavior, just causes my script to quickly display programs library, then jump back to the home menu.

Am I missing something simple? I don't seem to see any examples online which have to manage this behaviour? I was expecting the notification to seamlessly display regardless of the current active kodi window.

Please help!!

==========EDIT==========
Ok, I just realised it's nothing to do with the notifications. If I comment out the notification part of my code, I am still taken to add on library when the script is run... so is there any way to prevent kodi from doing this when my script is run? I was wondering if having a service would be a better option, and I can just update the data every x seconds/minutes?
Reply
#2
sounds like you've written a plugin instead of a script.

if post a link to the addon code we may be able to tell what is going wrong.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
ronie you were right! Many thanks!

I went into my addon.xml (which I threw together from online tutorials) and I had the "id="plugin.program.my.program" and extension point="xbmc.python.pluginsource".

I changed these to id="script.my.program" and extension point="xbmc.python.script" and it's working as I wanted, nice clean notification from the home menu custom button Smile

Many thanks! Now to tidy up and see if kodi will let me be in their official repository Wink
Reply

Logout Mark Read Team Forum Stats Members Help
Notification keeps changing window to programs library!?0