2015-03-23, 23:41
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
Tried notification methods:
I'v even tried adding:
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?
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
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?