Hi guys,
Just looking to see if anyone knows how to auto start a plugin on start up of after a certain time after startup.
I would like to make plugin "PictureCenterFS" auto start into a gallery if possible
Hi guys,
Just looking to see if anyone knows how to auto start a plugin on start up of after a certain time after startup.
I would like to make plugin "PictureCenterFS" auto start into a gallery if possible
1. Edit the Plugin's plugin.py
If the plugin doesn't already have a mechanism for autostarting, you can edit its plugin.py file or add a separate script.
PictureCenterFS plugin plugin.py code example:
from Plugins.Plugin import PluginDescriptor
from Plugins.Extensions.PictureCenterFS.plugin import PictureCenterFS7
import Screens.Standby
import time
def autostart(session, **kwargs):
# Auto-launch the gallery
session.open(PictureCenterFS7)
def Plugins(**kwargs):
return [PluginDescriptor(where=PluginDescriptor.WHERE_SESSIONSTART, fnc=autostart)]
Display More
2. Delayed Start
If you want to delay the start, you can use reactor.callLater:
for eg..
from Plugins.Plugin import PluginDescriptor
from Plugins.Extensions.PictureCenterFS.plugin import PictureCenterFS7
import Screens.Standby
import time
def autostart(session, **kwargs):
def open_gallery():
session.open(PictureCenterFS7)
# 300 second delay
from twisted.internet import reactor
reactor.callLater(300, open_gallery)
# # add to def Plugins(**kwargs):
plist = []
plist.append(PluginDescriptor(name="PictureCenterFS", where=PluginDescriptor.WHERE_SESSIONSTART, fnc=autostart))
Display More
as for the personal gallery, you then have to modify the plugin in some points, in my opinion, based on what you need to do, but the discussion becomes more delicate
Don’t have an account yet? Register yourself now and be a part of our community!