DeviceCapability

Extends

Instance Properties

lastChanged

lastChanged: Date|null

Type

  • Date | null

value

value: boolean|number|string|null

Type

  • boolean | number | string | null

Instance Methods

addListener

addListener(event, callback)

Parameters

Name Type Description
event
string
callback
function

destroy

destroy()

Destroy this capability listener, and if it's the last one, unsubscribe from the device's realtime events.

emit

emit(event, …data)

Parameters

Name Type Description
event
string
data
any <repeatable>

off

off(event, callback)

Parameters

Name Type Description
event
string
callback
function

on

on(event, callback)

Parameters

Name Type Description
event
string
callback
function

once

once(event, callback)

Parameters

Name Type Description
event
string
callback
function

removeAllListeners

removeAllListeners(eventopt)

Parameters

Name Type Description
event
string <optional>

removeListener

removeListener(event, callback)

Shortcut to EventEmitter#off

Parameters

Name Type Description
event
string
callback
function

setValue

(async) setValue(value, optsopt)

Sets a new capability value.

Parameters

Name Type Description
value
boolean | number | string

The new capability value

opts
object <optional>
duration
number <optional>
}