Domotz Generic Context
Extends
Methods
(static) DomotzGenericContext.createTable(label, columnHeaders) → {driverTable}
Creates a driver table for variable values visualization in a table format
Parameters:
Name | Type | Description |
---|---|---|
label |
string | The Table Label |
columnHeaders |
Array.<ColumnHeader> | The List of column header definitions |
Returns:
- The Custom Driver Table object
- Type
- driverTable
Example
D.createTable("My Table", [{"label": "Column A"}, {"label": "Column B", "unit": "%"}])
(static) DomotzGenericContext.createVariable(uid, name, value, unit, valueType) → {Variable}
Creates a custom driver variable to be sent in the D.success callback.
This variable is suited for tracking a single key-value pair, if you want to track tabular data, use D.createTable instead.
This variable is suited for tracking a single key-value pair, if you want to track tabular data, use D.createTable instead.
Parameters:
Name | Type | Description |
---|---|---|
uid |
string | The identifier of the variable. Must be Unique. Max 50 characters
cannot be one of the following reserved words: "table", "column", "history" |
name |
string | The Name/Label of the variable. Max 100 characters |
value |
string | The Value of the variable. Max 500 characters |
unit |
string | The Unit of measurement of the variable (eg %). Max 10 characters |
valueType |
ValueType | The value type of the variable (used for display purposes) |
Returns:
- Type
- Variable
Example
// returns {"uid": "1a", "unit": "C", "value": 60, "label": "CPU Temperature"}
D.createVariable('1a', 'CPU Temperature', 60, 'C', D.valueType.NUMBER)
(static) DomotzGenericContext.success(variablesopt, tableopt)
Success callback in D (D.success).
It must be present in validate, get_status or all custom action functions code (or their callbacks)
in order to indicate their successful execution
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
variables |
Array.<Variable> |
<optional> |
The variables to return (dry run) or store |
table |
driverTable |
<optional> |
The custom driver table to return (dry run) or store |
Examples
D.success()
D.success(table)
D.success(variables)
D.success(variables, table)