Skip to content

Variable Specific Methods

variableCreated()

This method will get called whenever a new variable is created. You can call the indigo.variables.subscribeToChanges() method to have the IndigoServer send all variable creation/update/deletion notifications. As with other change subscriptions, this should be used very sparingly since it's a lot of overhead both for your plugin and, more importantly, for the IndigoServer.

Method

Method Required
variableCreated(self, var) No

Parameters

Parameter Description
var an indigo.Variable object representing the variable that was created

Return Value:

Type Description
None This method does not return a value.

Exceptions Raised

Type Description

Command Syntax Examples

def variableCreated(self, var):
    pass  # respond to the newly-created variable as needed

variableDeleted()

Complementary to the variableCreated() method described above, but signals variable deletes.

Method

Method Name Required
variableDeleted(self, var) No

Parameters

Parameter Description
var an indigo.Variable object representing the variable that was deleted

Return Value:

Type Description
None This method does not return a value.

Exceptions Raised

Type Description

Command Syntax Examples

def variableDeleted(self, var):
    pass  # respond to the deleted variable as needed

variableUpdated()

Complementary to the variableCreated() method described above, but signals variable updates. You'll get a copy of the old variable object as well as the new variable object.

Method

Method Name Required
variableUpdated(self, origVar, newVar) No

Parameters

Parameter Description
origVar an indigo.Variable object representing the variable before the change
newVar an indigo.Variable object representing the variable after the change

Return Value:

Type Description
None This method does not return a value.

Exceptions Raised

Type Description

Command Syntax Examples

def variableUpdated(self, origVar, newVar):
    pass  # respond to the updated variable as needed

That’s all the methods that will be called automatically by the host process. You may, of course, define many more methods. Some that you will probably want to define: methods to be called when a button is clicked in a <ConfigUI> dialog and methods called by <MenuItems> and <Actions>.

You can also define your own classes, either in plugin.py or more likely in separate files. We believe the plugin host process offers you a great deal of flexibility in how you construct your Python code.