| Both sides previous revision Previous revision Next revision | Previous revision |
| indigo_2023.1_documentation:plugin_guide [2025/04/14 20:10] – external edit 127.0.0.1 | indigo_2023.1_documentation:plugin_guide [2025/10/22 14:45] (current) – [Custom HTML Menu Item Dialogs] davel17 |
|---|
| === Custom HTML Config Dialogs === | === Custom HTML Config Dialogs === |
| |
| You can also implement your own custom configuration in HTML if you prefer. Rather than adding lots of //''<Field>''// definitions, you simply specify a //''<URL>''// element. The URL specified can either be a fully specified URL (%%protocol://host/path%%) or it may be a relative URL (/some/relative/path). If it's the later then Indigo will attempt to guess the [[indigo_2022.2_documentation:server_commands&#get_web_server_url|best base URL]]. You would then handle those form requests using [[#processing_http_requests_in_your_plugin|the built-in request handling mechanism discussed below]]. See the **Example HTTP Responder** plugin in the [[https://github.com/IndigoDomotics/IndigoSDK/releases/tag/v2022.2|SDK]] for an example. | You can also implement your own custom configuration in HTML if you prefer. Rather than adding lots of //''<Field>''// definitions, you simply specify a //''<URL>''// element. The URL specified can either be a fully specified URL <nowiki>(protocol://host/path)</nowiki> or it may be a relative URL (/some/relative/path). If it's the later then Indigo will attempt to guess the [[indigo_2022.2_documentation:server_commands&#get_web_server_url|best base URL]]. You would then handle those form requests using [[#processing_http_requests_in_your_plugin|the built-in request handling mechanism discussed below]]. See the **Example HTTP Responder** plugin in the [[https://github.com/IndigoDomotics/IndigoSDK/releases/tag/v2022.2|SDK]] for an example. |
| ==== Devices.xml ==== | ==== Devices.xml ==== |
| |
| {{:indigo_2023.1_documentation:screenshot_2023-02-22_at_1.07.12_pm.png?nolink&600|Device Factory Edit Device Group Image}} | {{:indigo_2023.1_documentation:screenshot_2023-02-22_at_1.07.12_pm.png?nolink&600|Device Factory Edit Device Group Image}} |
| |
| One way to create "multifunction" devices is to use Indigo's Device Factory method. Device Factory devices are defined by using a special ''%%<DeviceFactory>%%'' node in ''Devices.xml''. A basic Device Factory device definition would look something like this: | One way to create "multifunction" devices is to use Indigo's Device Factory method. Device Factory devices are defined by using a special ''<DeviceFactory>'' node in ''Devices.xml''. A basic Device Factory device definition would look something like this: |
| |
| <code xml> | <code xml> |
| </code> | </code> |
| |
| Note that when the ''%%<Device Factory%%>'' node is present, devices that include the ''subType'' attribute will not be presented to the user as individual device types when they elect to create a new plugin device (it's not possible to have a Device Factory implementation and individual plugin device definitions together). You define sub-devices like any other device type, with the addition of the ''subType'' attribute: | Note that when the ''<Device Factory>'' node is present, devices that include the ''subType'' attribute will not be presented to the user as individual device types when they elect to create a new plugin device (it's not possible to have a Device Factory implementation and individual plugin device definitions together). You define sub-devices like any other device type, with the addition of the ''subType'' attribute: |
| |
| <code xml> | <code xml> |
| === Custom HTML Menu Item Dialogs === | === Custom HTML Menu Item Dialogs === |
| |
| You can also implement your own custom menu item form in HTML if you prefer. Rather than adding //''<CallbackMethod>''// and //''<ConfigUI>''// definitions, you simply specify a //''<URL>''// element. The URL specified can either be a fully specified URL (%%protocol://host/path%%) or it may be a relative URL (/some/relative/path). If it's the later then Indigo will attempt to guess the [[indigo_2023.1_documentation:server_commands&#get_web_server_url|best base URL]]. You would then handle those form requests using [[#processing_http_requests_in_your_plugin|the built-in request handling mechanism discussed below]]. See the **Example HTTP Responder** plugin in the [[https://github.com/IndigoDomotics/IndigoSDK/releases/tag/v2023.1|SDK]] for an example. | You can also implement your own custom menu item form in HTML if you prefer. Rather than adding //''<CallbackMethod>''// and //''<ConfigUI>''// definitions, you simply specify a //''<URL>''// element. The URL specified can either be a fully specified URL //''<nowiki>(protocol://host/path)</nowiki>''// or it may be a relative URL //''(/some/relative/path)''//. If it's the later then Indigo will attempt to guess the [[indigo_2023.1_documentation:server_commands&#get_web_server_url|best base URL]]. You would then handle those form requests using [[#processing_http_requests_in_your_plugin|the built-in request handling mechanism discussed below]]. See the **Example HTTP Responder** plugin in the [[https://github.com/IndigoDomotics/IndigoSDK/releases/tag/v2023.1|SDK]] for an example. |
| |
| ==== SupportURL Elements ==== | ==== SupportURL Elements ==== |
| |
| Anywhere you can specify a //''<SupportURL>''// element, the value can be either a full URL or a relative URL. If it's relative, then Indigo will attempt to guess the [[indigo_2023.1_documentation:server_commands&#get_web_server_url|best base URL]]. You can use this to supply [[indigo_2023.1_documentation:plugin_guide#resources_folder|static HTML]] files or dynamic help provided through the [[#processing_http_requests_in_your_plugin|HTTP processing API discussed below]]. | Anywhere you can specify a //''<SupportURL>''// element, the value can be either a full URL or a relative URL. If it's relative, then Indigo will attempt to guess the [[indigo_2023.1_documentation:server_commands&#get_web_server_url|best base URL]]. You can use this to supply [[indigo_2023.1_documentation:plugin_guide#resources_folder|static HTML]] files or dynamic help provided through the [[#processing_http_requests_in_your_plugin|HTTP processing API discussed below]]. |
| ==== plugin.py ==== | ==== plugin.py ==== |