Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
indigo_2025.1_documentation:plugin_scripting_tutorial [2025/10/22 02:40] – [Event Data Examples] davel17indigo_2025.1_documentation:plugin_scripting_tutorial [2025/10/22 15:27] (current) – [Execute Action Group 12345678:] jay
Line 154: Line 154:
 </code> </code>
  
-Custom Python classes that you create can implement the %%__str__(self)%% method. Take this simple example:+Custom Python classes that you create can implement the //''__str__(self)''// method. Take this simple example:
  
 <code> <code>
Line 192: Line 192:
  
 ===Execute Action Group 12345678:=== ===Execute Action Group 12345678:===
 +Execute an action group:
 <code> <code>
 indigo.actionGroup.execute(12345678) indigo.actionGroup.execute(12345678)
 </code> </code>
 +===Execute Action Group 12345678 with extra event data:===
  
 +Execute an action group, but pass through an arbitrary dictionary of data to actions that support using **event_data**:
 +<code>
 +extra_data = {"a": 1, "b": ["c", 2, 3]}
 +indigo.actionGroup.execute(12345678, event_data=extra_data)
 +</code>
  
 ==== Log Examples ==== ==== Log Examples ====
Line 295: Line 302:
 <code> <code>
 # If you did a indigo.actionGroup.execute(12345) the source would be `python`. # If you did a indigo.actionGroup.execute(12345) the source would be `python`.
-# You don't need to import `event data`, it will be made available automatically+# You don't need to import `event data`, it will be made available automatically.
 if event_data["source"] == "python": if event_data["source"] == "python":
     indigo.server.log(f"{event_data['timestamp']}" # or whatever     indigo.server.log(f"{event_data['timestamp']}" # or whatever
Line 301: Line 308:
 </code> </code>
  
 +All event_data payloads will be formatted as //''<class 'indigo.Dict'>''//.
 ==== Miscellaneous Examples ==== ==== Miscellaneous Examples ====
  
  • /www/perceptive/wiki/data/attic/indigo_2025.1_documentation/plugin_scripting_tutorial.1761100807.txt.gz
  • Last modified: 2025/10/22 02:40
  • by davel17