Page 1 of 1

Disable a Plug-In

PostPosted: Wed Jun 28, 2017 4:00 pm
by CraigM
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

Re: Disable a Plug-In

PostPosted: Wed Jun 28, 2017 4:13 pm
by DaveL17
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

Re: Disable a Plug-In

PostPosted: Wed Jun 28, 2017 4:25 pm
by jay (support)
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.