| Next revision | Previous revision |
| indigo_2025.2_documentation:api [2026/04/07 18:27] – created - external edit 127.0.0.1 | indigo_2025.2_documentation:api [2026/05/01 18:12] (current) – [variable command messages] davel17 |
|---|
| |
| === variable command messages === | === variable command messages === |
| The ''updateValue'' command is currently the only command message you can send to the variable feed. It closely mirrors the Python-based [[indigo_2025.2_documentation:object_model_reference|IOM command for updating variables]]. This was completely intentional to make learning one API a stepping stone to another. The HTTP API messages and the Websocket API messages are identical, and are very clearly a JSON-rendered version of the associated IOM command. | Variable commands closely mirror the Python-based [[indigo_2025.2_documentation:object_model_reference|IOM command for variable objects]]. This was completely intentional to make learning one API a stepping stone to another. The HTTP API messages and the Websocket API messages are identical, and are very clearly a JSON-rendered version of the associated IOM command. |
| | |
| | == create == |
| | |
| | The id key is optional, but may contain a user generated ID that will be logged and returned to help match up with message requests. Custom id values should be strings. The parameters dict is required and must contain a value key/value pair. The value must be a string, but an empty string is accepted. The folder key/value pair is optional. If a folder ID is included that doesn't exist, Indigo will ignore it and create the variable outside all folders. |
| | |
| | <code json> |
| | { |
| | "id": "optional-message-id", |
| | "message": "indigo.variable.create", |
| | "objectId": "new_name", |
| | "parameters": { |
| | "value": "new value", |
| | "folder": 12345678, |
| | } |
| | } |
| | </code> |
| |
| == updateValue == | == updateValue == |
| |
| === Variable Command Messages === | === Variable Command Messages === |
| The only action that can currently be performed on a variable is to update the value. The ''id'' key is optional, but may contain a user generated ID that will be logged and returned to help match up with message requests. Custom ''id'' values should be strings. | |
| | == indigo.variable.create == |
| | The ''id'' key is optional, but may contain a user generated ID that will be logged and returned to help match up with message requests. Custom ''id'' values should be strings. The ''parameters'' dict is required and must contain a ''value'' key/value pair. The value must be a string, but an empty string is accepted. The ''folder'' key/value pair is optional. If a folder ID is included that doesn't exist, Indigo will ignore it and create the variable outside all folders. |
| | |
| | **create** ''[[variable_class#create|indigo.variable.create(123456789, value="Some string value", folder=12345678)]]'' |
| | |
| | <code json> |
| | { |
| | "id": "optional-message-id", |
| | "message": "indigo.variable.create", |
| | "objectId": "new_name", |
| | "parameters": { |
| | "value": "new value", |
| | "folder": 12345678, |
| | } |
| | }</code> |
| | |
| | == indigo.variable.updateValue == |
| | The ''id'' key is optional, but may contain a user generated ID that will be logged and returned to help match up with message requests. Custom ''id'' values should be strings. |
| |
| **updateValue** ''[[variable_class#update_value|indigo.variable.updateValue(123456789, value="Some string value")]]'' | **updateValue** ''[[variable_class#update_value|indigo.variable.updateValue(123456789, value="Some string value")]]'' |