Plugin Developer Documenter Plugin v2

Plugins to extend Indigo integration to additional hardware and apps to extend Indigo onto other platforms.
User avatar
Posts: 2516
Joined: Tue Nov 13, 2012 3:54 pm
Location: Baton Rouge, LA

Plugin Developer Documenter Plugin v2

Post by RogueProeliator »

Quick Links: GitHub Repo | Plugin Download

Plugin Developer Documenter Plugin v2
After a very long hiatus, the Indigo Plugin Developer Documenter makes a return supporting new plugin features and paradigms that have been released in the years since the previous version fell behind. For those that were not around back then, or aware of its existence, this plugin allows plugin developers to examine and follow the lifecycle of calls that are available when developing an Indigo Plugin. The plugin is meant as a demonstration and learning tool for both new and experienced developers alike -- I learned a few new things just in doing this exercise, as was the point.

I have tried to thoroughly document the plugin's code so that you may easily follow what is going on and how to use a feature/callback in your own plugin should you find the need. I have also attempted to document in the code where you must be sure to call the base class implementation lest you inadvertently break the lifecycle.

The features demonstrated and documented here go well beyond the Indigo SDK, but are meant as a more advanced supplement to those examples - certainly not a replacement. In fact, this plugin does not go into any standard Indigo device types which are more than handled by examining the SDK. Rather, this is intended to allow developers to closely follow the entire plugin lifecycle and as a playground to experiment with advanced features.

New plugin developers, however, can gain some insight into various aspects of plugin development that are easily seen all in one places - various examples of using text fields, labels, lists, etc.

The plugin, by default, will simply log each function call / event that is executed within the plugin. To see the order of events simply use the plugin - create a new plugin device, open/close dialogs, press buttons within the dialogs, etc. This level of logging is fairly low since, as long as you are not actively using the plugin and devices, there are not many function calls.

If you want more details, you may turn on additional logging options in the plugin configuration dialog -- such as the parameter values for each of those function calls. Be warned, though, this will dump a LOT of data to your log when things such as devices are passed in to routines. You will want to use this when learning/debugging and then shut it off for normal use.

The plugin also demonstrates, and logs, the calls that you may receive when other Indigo objects (outside of your plugin) change, such as variables. These options may be turned on and off from the plugin configuration dialog as well. There is no way to unsubscribe to these changes, so when you are ready to stop subscribing to, say, all Indigo Variable changes, you will need to uncheck this box, save the change and then reload the plugin.

Finally, there are specific example dialogs for many of the UI elements and concepts available in Indigo plugins, such as:
  • Labels and various appearances
  • Text fields and their states (e.g. binding, readonly, etc.)
  • Various list/menu options - refreshing, dynamic, static, etc.
  • Auto-refreshing configuration UIs
  • ... and more ...
Plugin Devices / Dialogs
The plugin defines a single, custom device type and a nonsense device configuration just to demonstrate the various options that affect the lifecycle of the plugin. You will want to create one of these in order to view the lifecycle of calls around creation, starting, configuring, etc. a device. This device supports a couple of actions, again meant to allow you to trace the lifecycle that occurs when a plugin action executes.

A single event is also available that will allow you to examine how to create, register and execute custom Events and what that lifecycle entails.

Again, if you are looking for a specific device type, such as working on a sprinkler or relay, your best bet is the Indigo SDK examples.

Review / Improvement / Modification
If anyone sees anything missing from the documentation and plugin, some incorrectly documented information or has any other suggestions for improvement then please let me know! I will leave this thread open for discussion since I don't anticipate announcements of changes being a particularly big deal for this due to its intended audience. Special shout out to DaveL for checking over the plugin and making suggestions!

Feel free to leave suggestions, comments, requests, etc. here as there is no dedicated forum. Also note, this is intended for developers so it is only available via the GitHub repository; I didn't think there was a need to put it in the store, but if people feel otherwise, I certainly can.

Plugin Releases / Download


Return to “RogueProeliator's Plugins and Apps”