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.