Plugin Info¶
indigo.server.getPlugin() and indigo.server.getPluginList()
return a PluginInfo object describing an installed plugin. It carries the plugin's identity and
its Plugin Store status, and it is how a script restarts a plugin or runs one of the actions that
plugin defines.
myPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.timersandpesters")
if myPlugin.isEnabled():
indigo.server.log(f"{myPlugin.pluginDisplayName} {myPlugin.pluginVersion} is enabled")
A plugin's own API is not described here
PluginInfo is the same for every plugin. What a specific plugin can do — the action type
ids you pass to Execute Action, and the properties each one takes — is
defined by that plugin and documented by its author. See
Scripting Indigo Plugins for a worked example.
Class Properties
All properties are read-only.
| Property | Type | Description |
|---|---|---|
pluginId |
string | the plugin's unique id, e.g. com.company.pluginId |
pluginDisplayName |
string | the human-readable plugin name, as shown in the Plugins menu |
pluginVersion |
string | the installed version string |
pluginFolderPath |
string | POSIX path to the installed plugin bundle |
pluginBundleId |
string | the plugin bundle's macOS bundle identifier |
apiVersion |
string | the API version the plugin declares it is written against |
serverApiVersion |
string | the minimum server API version the plugin requires |
priority |
integer | the plugin's load priority |
debuggingEnabled |
boolean | true if debugging is currently enabled for the plugin |
isLoaded |
boolean | true if the plugin process is loaded |
updateAvailable |
boolean | true if the Plugin Store has a newer version than the one installed |
latestVersion |
string | the newest version string available in the Plugin Store |
storeDescription |
string | the plugin's Plugin Store description |
storeDownloadURL |
string | URL to download the plugin |
storeReleaseNotesURL |
string | URL to the plugin's release notes |
storeChangelogURL |
string | URL to the plugin's changelog |
isLoaded and isRunning() are not the same thing
isLoaded reports whether the plugin process is loaded. Is Running asks the
server whether it is running right now. Use the method when you are about to act on the
plugin, since a property read from a PluginInfo you fetched earlier may be stale.
Commands (PluginInfo.*)¶
These are called on the object rather than on indigo.server.
Is Installed¶
Returns True if the plugin is installed.
Command Syntax Examples
myPlugin.isInstalled()
Is Enabled¶
Returns True if the plugin is enabled. A disabled plugin is installed but not running, and
will not appear in getPluginList() unless you pass includeDisabled=True.
Command Syntax Examples
myPlugin.isEnabled()
Is Running¶
Returns True if the plugin process is currently running.
Command Syntax Examples
myPlugin.isRunning()
Restart¶
Restarts the plugin process.
Command Syntax Examples
myPlugin.restart()
myPlugin.restart(waitUntilDone=False)
Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
waitUntilDone |
No | boolean | wait for the restart to finish before returning (defaults to True) |
Don't restart the plugin you are running inside
A plugin restarting itself from its own script will kill the process running that script.
Restart And Debug¶
Restarts the plugin process with debugging enabled, the same as the plugin's Enable Debugging
menu item.
Command Syntax Examples
myPlugin.restartAndDebug()
Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
waitUntilDone |
No | boolean | wait for the restart to finish before returning (defaults to True) |
Execute Action¶
Executes one of the actions the plugin defines. Returns whatever the plugin's action returns — a
dictionary or a string — or None if waitUntilDone is False.
Command Syntax Examples
myPlugin.executeAction("actionTypeId")
myPlugin.executeAction("actionTypeId", deviceId=123456789, props={"key": "value"})
Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
actionTypeId |
Yes | string | the id of the action to execute, as defined in the plugin's Actions.xml |
deviceId |
No | integer | the device to act on, for a device-specific action (defaults to 0, meaning none) |
props |
No | dictionary | the action's properties, as the plugin's ConfigUI would supply them (defaults to None) |
waitUntilDone |
No | boolean | wait for the action to finish and return its result (defaults to True) |
See Scripting Indigo Plugins for a worked example, and the Plugin Developer's Guide for how a plugin defines its actions.