D
- Description:
- 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
- Description:
- Known Domotz Context Error types
Known Domotz Context Error types
Type:
Example
D.errorType.AUTHENTICATION_ERROR
(static, readonly) valueType :ValueType
- Description:
- Domotz Variable Value Types
Domotz Variable Value Types
Type:
Example
D.valueType.MONOTONE_RATE
Methods
(static) createExternalDevice(deviceHost, deviceCredentialsopt) → {device}
- Description:
- Creates an External IP device object
Example
D.createExternalDevice("1.1.1.1", {"username": "root", "password": D.device.password()})
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
(static) failure(errorTypeopt)
- Description:
- Failure callback in D (D.failure). It can be present in any function in order to indicate a failure in the execution
Example
D.failure(D.errorType.AUTHENTICATION_ERROR)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
errorType |
ErrorType |
<optional> |
The type of error that caused the failure callback. Must be a member of D.errorType |
(static) getParameter(parameterName) → {string|number|Object|undefined}
- Description:
- Get a predefined parameter during execution by its name. Returns undefined in case the parameter was not provided to the context.
Example
D.getParameter("name")
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