Disable a Plug-In

Posted on
Wed Jun 28, 2017 4:00 pm
CraigM offline
Posts: 589
Joined: Oct 28, 2007

Disable a Plug-In

Whenever I experience a home power disruption, even as short as 1-2 seconds, my Pioneer Receiver never recovers communication with the Pioneer Receiver Plug-In.

This, doesn't bring it to life
Code: Select all
plugin = indigo.server.getPlugin("com.nathansheldon.indigoplugin.PioneerReceiver")
if plugin.isEnabled():
   plugin.restart()

But I seem to have better luck with the menu items:
-Disable
and then
-Reload

Can I assume that the above code which uses restart, is the same as the menu's reload?

What term can be used to replace plugin.restart() to get it to function like the menu's Disable? plugin.disable() doesn't work

Posted on
Wed Jun 28, 2017 4:13 pm
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Disable a Plug-In

Jay and Matt might need to pipe up here, but my understanding is that you can only restart a plugin if it's already enabled. It would seem to me to be a security risk to allow a python script to start any plugin just by knowing its bundle identifier. I could put code in my plugin to start somebody else's plugin and that could potentially create trouble. :D

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Wed Jun 28, 2017 4:25 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Disable a Plug-In

Correct - we only allow restarts.

And, yes, restart/reload just disables the plugin then enables it. No idea why restart isn't working but a reload does, though my guess is that there's some other underlying problem (perhaps a comm issue) thats the real issue and it just appears that one works but the other doesn't.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests