Page 1 of 1

Automatically reloading a plugin on a schedule

PostPosted: Wed Oct 11, 2017 12:08 am
by zini
Forgive me if this is already answered somewhere but I couldn’t find it.

Is there a way to automatically reload a plugin on a certain schedule? For example, reload X plugin every morning at 3am.

Thanks!

Re: Automatically reloading a plugin on a schedule

PostPosted: Wed Oct 11, 2017 12:27 am
by autolog
Take a look at this post: Reload, enable, disable plugin via trigger action / script?

Set-up an Action Group as shown in the above post and then define a schedule to execute it. :)

Re: Automatically reloading a plugin on a schedule

PostPosted: Thu Oct 12, 2017 9:14 am
by zini
Jon,

Thank you. Sorry I missed that topic. :D

Re: Automatically reloading a plugin on a schedule

PostPosted: Tue Oct 24, 2017 10:48 am
by zini
Okay, so I understand the script now and how I would automatically reload a plugin. With that being said, I don't quite understand how to find the specific file path to correctly point to the plugin to make it reload.

My goal is currently to automatically reload the Better Email plugin since it seems that gmail will time out the IDLE. Would anyone happen to know what the script would look like to be able to do this?

Thanks.

Re: Automatically reloading a plugin on a schedule

PostPosted: Tue Oct 24, 2017 11:19 am
by jay (support)
If the plugin's ID isn't specified in it's docs (it should be just for this situation but sometimes isn't) then you can open the plugin by finding it in a Finder window, right-clicking it and select Show Package Contents. This will open the plugin bundle - select the Contents folder and then select the Info.plist file. You should see the contents in the quick-look pane, what you're looking for is the value under CFBundleIdentifier.

Re: Automatically reloading a plugin on a schedule

PostPosted: Tue Oct 24, 2017 12:49 pm
by FlyingDiver
Code: Select all
plugin = indigo.server.getPlugin("com.flyingdiver.indigoplugin.betteremail")
if plugin.isEnabled():
   plugin.restart()

But I think you'd get the same results by using the standard Indigo actions to disable and re-enable just the GMail IMAP device instead of restarting the entire plugin.

Or disable IDLE and go back to polling.