Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| indigo_7_documentation:plugin_scripting_tutorial [2024/09/23 22:30] – [Restart a Plugin] davel17 | indigo_7_documentation:plugin_scripting_tutorial [2025/04/14 20:10] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 94: | Line 94: | ||
| </ | </ | ||
| - | === Getting a variable object and using it' | + | === Getting a variable object and using its value: === |
| < | < | ||
| if myVar.value == " | if myVar.value == " | ||
| Line 196: | Line 196: | ||
| ==== Log Examples ==== | ==== Log Examples ==== | ||
| - | ===Log to the Indigo Event Log window all of the attributes/ | + | ===Log to the Indigo Event Log window all the attributes/ |
| < | < | ||
| lamp = indigo.devices[" | lamp = indigo.devices[" | ||
| Line 280: | Line 280: | ||
| < | < | ||
| - | {{pluginhost_prompt.png|}} | + | {{pluginhost_prompt.png?nolink|Plugin Host Prompt Image}} |
| As shown, the IPH will automatically connect to the IndigoServer running on the same Mac and will show the server' | As shown, the IPH will automatically connect to the IndigoServer running on the same Mac and will show the server' | ||
| Line 287: | Line 287: | ||
| < | < | ||
| - | {{pluginhost_helloworld.png|}} | + | {{pluginhost_helloworld.png?nolink|Hello World Code Example Image}} |
| ===== Connecting Remotely over SSH ===== | ===== Connecting Remotely over SSH ===== | ||
| Line 357: | Line 357: | ||
| raise ImportError | raise ImportError | ||
| from datetime import datetime | from datetime import datetime | ||
| - | | + | |
| def log(message, | def log(message, | ||
| # Create a log line with the date/ | # Create a log line with the date/ | ||
| Line 377: | Line 377: | ||
| If you try to run this script in a normal python session, you'll see the print statement followed by the ImportError: | If you try to run this script in a normal python session, you'll see the print statement followed by the ImportError: | ||
| - | < | + | < |
| The indigo module can only be used by scripts started from within Indigo | The indigo module can only be used by scripts started from within Indigo | ||
| Traceback (most recent call last): | Traceback (most recent call last): | ||
| Line 398: | Line 398: | ||
| | pluginDisplayName | | pluginDisplayName | ||
| | pluginId | | pluginId | ||
| - | | pluginSupportURL | + | | pluginSupportURL |
| | pluginVersion | | pluginVersion | ||
| Line 452: | Line 452: | ||
| ==== Debugging Errors ==== | ==== Debugging Errors ==== | ||
| A likely place where errors can creep into your plugin scripting involves the payloads that are sent to and from the Indigo Web Server API. For example, JSON payloads may be converted to XML behind the scenes, so bear in mind the XML conventions found in the [[plugin_guide# | A likely place where errors can creep into your plugin scripting involves the payloads that are sent to and from the Indigo Web Server API. For example, JSON payloads may be converted to XML behind the scenes, so bear in mind the XML conventions found in the [[plugin_guide# | ||
| + | |||