Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| indigo_2022.2_documentation:server_commands [2023/09/15 14:15] – [Subscribe To Log Broadcasts] davel17 | indigo_2022.2_documentation:server_commands [2025/02/18 20:36] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Server Properties and Commands (indigo.server.*) ====== | ||
| + | |||
| + | These are properties and commands that aren't associated with any specific object type and are inside the indigo.server.* command namespace. | ||
| + | |||
| + | ==== Properties (for connected Indigo Server) ==== | ||
| + | |||
| + | ^ Property | ||
| + | |//'' | ||
| + | |//'' | ||
| + | |//'' | ||
| + | |//'' | ||
| + | |//'' | ||
| + | |//'' | ||
| + | == License Status Enumeration == | ||
| + | |||
| + | ^ indigo.kLicenseStatus | ||
| + | ^//'' | ||
| + | |//'' | ||
| + | |''// | ||
| + | |//'' | ||
| + | |//'' | ||
| + | |||
| + | ==== Broadcast to Subscribers ==== | ||
| + | |||
| + | This command will broadcast message to other plugins that have subscribed to the specified name message. | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | indigo.server.broadcastToSubscribers(messageName) | ||
| + | </ | ||
| + | |||
| + | ==== 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 Database File Name ==== | ||
| + | |||
| + | Returns the name of the current database name (without the file extension). It takes no parameters. | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |||
| + | ==== Get Database File Path ==== | ||
| + | |||
| + | Returns the POSIX path to the current database file (includes the file name with extension). It takes no parameters. | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |||
| + | ==== Get Deprecated Elements ==== | ||
| + | |||
| + | Returns the server' | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |||
| + | ==== Get Install Folder Path ==== | ||
| + | |||
| + | Returns the POSIX path to the current Indigo installation path. Useful if you want to manipulate files (like graphics and scripts) that are in the Indigo installation path. It takes no parameters. | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |||
| + | ==== 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 Plugin List ==== | ||
| + | |||
| + | **[[api_release_notes: | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |||
| + | ==== Get Reflector URL ==== | ||
| + | |||
| + | **[[api_release_notes: | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |||
| + | === Examples === | ||
| + | |||
| + | < | ||
| + | " | ||
| + | ==== 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 === | ||
| + | |||
| + | < | ||
| + | |||
| + | ==== Get Web Server URL ==== | ||
| + | |||
| + | Returns a URL string that best represents the URL to the active Indigo Web Server. This is the order of which URL will be returned: | ||
| + | |||
| + | - Reflector (//'' | ||
| + | - Bonjour name (//''< | ||
| + | - Localhost (//''< | ||
| + | |||
| + | Note, there is no trailing slash. | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |||
| + | No Parameters | ||
| + | |||
| + | ==== 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. The examples below that refer to the logging package assume that you've done this somewhere before: '' | ||
| + | |||
| + | ^ 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 | ||
| + | |< | ||
| + | |||
| + | ==== Restart Plugin ==== | ||
| + | |||
| + | This command will tell the server to restart our plugin process. The message is printed to the event log, and if isError is true then it's logged as an error. This command can only be called from a plugin and it refers to the plugin itself (not other plugins). | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |||
| + | ==== Save Plugin Preferences ==== | ||
| + | |||
| + | The Indigo server will save changes to plugin preferences automatically, | ||
| + | |||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |||
| + | ==== Send Email ==== | ||
| + | |||
| + | This tells IndigoServer to send an email using the SMTP settings configured in the preferences " | ||
| + | |||
| + | ^ 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| | ||
| + | |''// | ||
| + | |||
| + | ==== Stop Plugin ==== | ||
| + | Tell the server to shutdown our plugin process. Plugin will remain enabled but be in a stopped state. This command can only be called from a plugin and it refers to the plugin itself (not all plugins). | ||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |||
| + | ==== Subscribe To Log Broadcasts ==== | ||
| + | Subscribes to all server event log broadcasts. This command does not take any parameters. | ||
| + | ^ Command Syntax Examples | ||
| + | |< | ||
| + | |||
| + | ==== Wait Until Idle ==== | ||
| + | Wait (block) until server has completed event processing and command sending. This command does not take any parameters. | ||
| + | ^ Command Syntax Examples | ||
| + | |< | ||