D

Namespace

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

_
crypto
device
math
tftpServer

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 object <optional>
The credentials for the external device
Properties
Name Type Description
username string The device username
password string The device password
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

(static) htmlParse(content, optionsopt, isDocumentopt) → {Object}

Description:
  • Html Parser Library
Example
D.htmlParse()
Parameters:
Name Type Attributes Default Description
content string | Node | Array.<Node> | Buffer Markup to be loaded.
options Object <optional>
Options for the created instance (see https://cheerio.js.org/interfaces/CheerioOptions.html)
isDocument boolean <optional>
true Allows parser to be switched to fragment mode.
Returns:
Type
Object