Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| indigo_5_documentation:server_commands [2011/09/08 02:33] – [Remove All Delayed Actions] mattb | indigo_5_documentation:server_commands [2025/02/18 20:36] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Server Commands (indigo.server.*) ====== | ||
| + | |||
| + | Commands that aren't associated with any specific object type are collected up in the indigo.server.* command namespace. | ||
| + | |||
| + | ==== Calculate Sunrise ==== | ||
| + | |||
| + | This command will return a datetime object that represents the sunrise for the specified day (or the next sunrise if no date is passed in). | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |< | ||
| + | |||
| + | ^ Parameters | ||
| + | ^ Parameter | ||
| + | |direct parameter| | ||
| + | |||
| + | ==== Calculate Sunset ==== | ||
| + | |||
| + | This command will return a datetime object that represents the sunset for the specified day (or the next sunset if no date is passed in). | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |< | ||
| + | |||
| + | ^ Parameters | ||
| + | ^ Parameter | ||
| + | |direct parameter| | ||
| + | |||
| + | ==== Event Log List ==== | ||
| + | |||
| + | This command will return a string that contains the latest log entries. Each line is terminated with a line feed character. | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |< | ||
| + | |< | ||
| + | |< | ||
| + | |< | ||
| + | |||
| + | ^ Parameters | ||
| + | ^ Parameter | ||
| + | |returnAsList| | ||
| + | |lineCount| | ||
| + | |showTimeStamp| | ||
| + | |||
| + | ==== Get Latitude and Longitude ==== | ||
| + | |||
| + | Returns a list of floating point numbers where the first float is the latitude and the second (and last) is the longitude. It takes no parameters. | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | lat = latLong[0] | ||
| + | long = latLong[1]</ | ||
| + | |||
| + | ==== Get Plugin ==== | ||
| + | |||
| + | Returns a plugin object given the plugin id. | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |||
| + | ^ Parameters | ||
| + | ^ Parameter | ||
| + | |direct parameter| | ||
| + | |||
| + | See [[https:// | ||
| + | |||
| + | ==== Get Serial Ports ==== | ||
| + | |||
| + | Returns a dictionary representing all serial ports on the server machine. The key is the full path specification for the port (for use by PySerial) and the value is just the name of the port (for display purposes). | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |< | ||
| + | |||
| + | ^ Parameters | ||
| + | ^ Parameter | ||
| + | |//'' | ||
| + | |||
| + | === Examples === | ||
| + | |||
| + | < | ||
| + | # iterate through the full paths | ||
| + | for posixPath in ports: | ||
| + | print(posixPath) | ||
| + | # iterate through just the port name itself | ||
| + | for uiName in ports.itervalues(): | ||
| + | print(uiName) | ||
| + | # iterate through both | ||
| + | for posixPath, uiName in ports.iteritems(): | ||
| + | print(posixPath) | ||
| + | print(uiName)</ | ||
| + | |||
| + | ==== Get Time ==== | ||
| + | |||
| + | Returns a datetime object representing the server' | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |||
| + | No Parameters | ||
| + | |||
| + | === Examples === | ||
| + | |||
| + | < | ||
| + | |||
| + | ==== Log ==== | ||
| + | |||
| + | This tells IndigoServer to write a log entry with the specified text. The type in the log will be the name of the plugin. | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |< | ||
| + | |< | ||
| + | |||
| + | ^ Parameters | ||
| + | ^ Parameter | ||
| + | |direct parameter| | ||
| + | |''// | ||
| + | |''// | ||
| + | |||
| + | ==== Remove All Delayed Actions ==== | ||
| + | |||
| + | This command will remove all delayed actions currently scheduled. It doesn’t take any parameters. | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |||
| + | ==== Send Email ==== | ||
| + | |||
| + | This tells IndigoServer to send an email using the SMTP settings configured in the preferences “Email” tab. | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |< | ||
| + | |||
| + | ^ Parameters | ||
| + | ^ Parameter | ||
| + | |direct parameter| | ||
| + | |''// | ||
| + | |''// | ||
| + | |||
| + | ==== Speak ==== | ||
| + | |||
| + | Speak a text string using the built-in speech synthesizer. | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |||
| + | ^ Parameters | ||
| + | ^ Parameter | ||
| + | |direct parameter| | ||
| + | |''// | ||