The Domotz Context Library
Used for accessing the domotz context within a custom driver.
Exposes the device namespace for any device related operations, utility libraries and driver callbacks
Namespaces
Members
(static, readonly) errorType :ErrorType
Known Domotz Context Error types
Type:
Example
D.errorType.AUTHENTICATION_ERROR
(static, readonly) valueType :ValueType
Domotz Variable Value Types
Type:
Example
D.valueType.MONOTONE_RATE
Methods
(static) createExternalDevice(deviceHost, deviceCredentialsopt) → {device}
Creates an External IP device object
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
deviceHost |
string | The IP or Hostname of the external device | |
deviceCredentials |
DeviceCredentials |
<optional> |
The credentials for the external device |
Returns:
- The External Device object
- Type
- device
Example
D.createExternalDevice("1.1.1.1", {"username": "root", "password": D.device.password()})
(static) failure(errorTypeopt)
Failure callback in D (D.failure).
It can be present in any function in order to indicate a failure in the execution
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
errorType |
ErrorType |
<optional> |
The type of error that caused the failure callback. Must be a member of D.errorType |
Example
D.failure(D.errorType.AUTHENTICATION_ERROR)
(static) getParameter(parameterName) → {string|number|Object|undefined}
Get a predefined parameter during execution by its name.
Returns undefined in case the parameter was not provided to the context.
Parameters:
Name | Type | Description |
---|---|---|
parameterName |
string | Name of the parameter to get |
Returns:
- the value associated with the provided parameter name
- Type
- string | number | Object | undefined
Example
D.getParameter("name")