try to reload a plugin

Posted on
Sun Jun 03, 2018 4:43 am
koburg offline
Posts: 148
Joined: Jul 27, 2017

try to reload a plugin

HI all

I try to make a action group to execute this python script

Code: Select all
plugin = indigo.server.getPlugin("com.ssi.indigoplugin.Sonos.indiPref")
if plugin.isEnabled():
   plugin.restart()


but nothing seem to happen when execute no info in the log about reloading or errors ?

Posted on
Sun Jun 03, 2018 5:15 am
FlyingDiver offline
Posts: 2990
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: try to reload a plugin

The identifier for the Sonos plugin is "com.ssi.indigoplugin.Sonos".

"com.ssi.indigoplugin.Sonos.indiPref" is the name of the preferences file.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Jun 03, 2018 5:16 am
koburg offline
Posts: 148
Joined: Jul 27, 2017

Re: try to reload a plugin

Ok thanks but why do the log not show any errors ?

Posted on
Sun Jun 03, 2018 11:02 am
matt (support) offline
Site Admin
User avatar
Posts: 19134
Joined: Jan 27, 2003
Location: Texas

Re: try to reload a plugin

The call to retrieve a plugin always succeeds, even if the plugin isn't installed (or doesn't exist). Indigo has no way to know if a given pluginID is invalid or if that plugin just isn't installed. This is documented (but probably not clear enough) here, "This will always return to you a plugin object."

The plugin object is returned with a display name that says it isn't installed. If after getting the plugin you add this line to the script:

indigo.server.log("plugin returned:\n" + unicode(plugin))

You will see this in the Event Log window:

Code: Select all
   Script                          plugin returned:
pluginDisplayName : - plugin not installed -
pluginId : com.ssi.indigoplugin.Sonos.indiPref
pluginSupportURL :
pluginVersion :

The isEnabled() method returns False for that placeholder plugin, so the restart in your script is never executed.

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests