plugins:02_infojson
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
plugins:02_infojson [2017/07/14 13:21] – external edit 127.0.0.1 | plugins:02_infojson [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | =====Plugin API: info.json and Communication Settings===== | ||
- | The info.json file contains all the information necessary to load your script files, provide the basic communications, | ||
- | |||
- | ==script== | ||
- | REQUIRED: (string) The scripting language that the plugin is written in. As of plugin API version 1 the only supported value for this key is “python2” Since Python 2.7 is by default included with MacOS this version was chosen as it doesn’t require the user to do an install of python 3 separately. If Apple ever includes the newer versions we will update the API to support that as well. I will also consider other options for other scripting languages. Currently on my list for future consideration are Javascript and Lua. If those are things you’d like to see please let me know. | ||
- | |||
- | ==name== | ||
- | REQUIRED: (string) The name of the plugin that will be displayed in the popup of available interface types. This should be a short name ie: " | ||
- | |||
- | ==tag== | ||
- | REQUIRED: (string) The tag is a short string used by the program to identify items belonging to this plugin. It should be a short unique string. It must be unique so you should consider | ||
- | |||
- | ==isf== | ||
- | REQUIRED: (string) The folder name that the plugin files live in. | ||
- | |||
- | ==module== | ||
- | REQUIRED: (string) The name of the script file to load from inside the isf folder. In the case of the python plugin this should be the name of the myPlugin.py file that is the main entry point for your plugin but without the file extension. So if your file name was myPlugin.py you would enter just “myPlugin" | ||
- | |||
- | |||
- | ==desc== | ||
- | OPTIONAL: (string) A short description of the plugin or the device it supports. This is shown in parans next to the name of the plugin in the popup to give the user a quick idea of just what your plugin does. This needs to fit in a reasonable space after the name in the popupmenu so should not be long winded. Use the " | ||
- | |||
- | ==info== | ||
- | OPTIONAL: (string) Optional but should always be included. A 2 or 3 line long description of the plugin | ||
- | |||
- | ==wiki== | ||
- | OPTIONAL: (url) if your plugin has a page on the MacHomeAutomation.com wiki you should | ||
- | |||
- | ==link== | ||
- | OPTIONAL: (url) if your plugin has a web page elsewhere, or can link to a device | ||
- | |||
- | ==vers== | ||
- | REQUIRED: (integer) | ||
- | |||
- | ==readableVers== | ||
- | OPTIONAL: (string) a more human readable version string like 6.5.4 or 4.5.6.334.234 | ||
- | |||
- | ==checkVersLink== | ||
- | OPTIONAL: (url) a link to a JSON file on your server that contains the current and | ||
- | |||
- | ==APIVersion== | ||
- | REQUIRED: (integer) the API version that is required to run your plugin. We are currently at API version 1. XTension may be able to support older API versions if called for by a plugin, but plugins that require a newer version will refuse to load and log an error. | ||
- | |||
- | ===Connection Control=== | ||
- | The plugin host can handle simple communications via an outgoing TCP port or serial | ||
- | |||
- | ==allowNone== | ||
- | OPTIONAL: (boolean) defaults to false. If your plugin does not require normal | ||
- | |||
- | ==portSelectNone== | ||
- | OPTIONAL: (boolean) if present and set to true the communications popup will be forced to select None and then disabled so that no other communications options | ||
- | |||
- | ==allowTCP== | ||
- | OPTIONAL: (boolean) defaults to True. Allows for the opening of an outgoing TCP connection. If absent or present and True this will allow the selection of " | ||
- | |||
- | ==portSelectOutgoing== | ||
- | OPTIONAL: (boolean) if present and True the communications selection popup will be forced to select " | ||
- | |||
- | ==defaultPort== | ||
- | OPTIONAL: (integer) if included then this will be offered as the pre-filled in value in the TCP connection Port field. | ||
- | |||
- | ==allowSerial== | ||
- | OPTIONAL: (boolean) defaults to True. Allows the selection of available serial | ||
- | |||
- | ==baud== | ||
- | REQUIRED if AllowSerial: | ||
- | \\ | ||
- | There are other serial port settings such as parity and flow control and enabling of the dtr line that can be added to a future version. If your device needs this please let me know. | ||
- | |||
- | ==packetBoundry== | ||
- | OPTIONAL: (formatted string, see below) If the device you're talking to uses a simple | ||
- | |||
- | ===Accepting Incoming Connections=== | ||
- | Incoming connection support is not enabled in XTension 9.3.1 but will appear in a not too distant future release. | ||
- | |||
- | ==TCPListen== | ||
- | OPTIONAL: (boolean) defaults to false. If present and true the user will have the | ||
- | |||
- | ==portSelectIncoming== | ||
- | OPTIONAL: (boolean) if present and True the communications popup will be forced to | ||
- | |||
- | ==defaultPort== | ||
- | OPTIONAL: (integer) if present this will be filled in to the port field for the incoming | ||
- | |||
- | ==allowTCP== | ||
- | OPTIONAL: (boolean) defaults to True. If your interface needs to accept incoming TCP communications this should be left out or set to true. | ||
- | |||
- | ==allowUDP== | ||
- | OPTIONAL: (boolean) defaults to False. If your inteface needs to accept UDP packets on the specified port you should include this parameter as True. Each packet received will be a single call to dataAvailable. You will be responsible for any protocol management or | ||
- | |||
- | ==allowBonjour== | ||
- | OPTIONAL: (boolean) defaults to True. Allows for you to register a bonjour, zero-conf or mDNS name on the local network making it easier to find. | ||
- | |||
- | ==defaultBonjourName== | ||
- | OPTIONAL: (string) if present this will be offered as the default Bonjour name for the service you are registering. This is the DNS name that other devices will use to find your server. | ||
- | |||
- | ==defaultBonjourService== | ||
- | OPTIONAL: (string) though optional you should definitely include this. This is the default service name for the bonjour so that anyone searching for a specific type of | ||
- | |||
- | PREVIOUS: [[plugins: | ||
plugins/02_infojson.1500038490.txt.gz · Last modified: 2023/02/13 14:51 (external edit)