Constructor
BoundCluster
new BoundCluster()Create a new BoundCluster instance.
Example
const { BoundCluster } = require('zigbee-clusters');
class MyBoundCluster extends BoundCluster {
toggle() {
// Do something when node sends `toggle` command to Homey
}
}
zclNode.endpoints[1].bind('onOff', new MyBoundCluster());
Properties
logId
logIdReturns log id string for this bound cluster.
Methods
discoverAttributes
(async) discoverAttributes(optionsopt): Promise.<DiscoverAttributesResponse>This method handles an incoming discoverAttributes
command send from the remote node
to the controller. It assembles the cluster's attributes which are implemented on this bound
cluster and returns a response.
Parameters
Name | Type | Description |
---|---|---|
options
|
object
<optional> |
|
startValue
|
number
<optional> default: 0
|
|
maxResults
|
number
<optional> default: 250
|
|
|
Returns
discoverAttributesExtended
(async) discoverAttributesExtended(optionsopt): Promise.<DiscoverAttributesExtendedResponse>This method handles an incoming discoverAttributesExtended
command send from the remote node
to the controller. It assembles the cluster's attributes which are implemented on this bound
cluster and returns a response.
Parameters
Name | Type | Description |
---|---|---|
options
|
object
<optional> |
|
startValue
|
number
<optional> default: 0
|
|
maxResults
|
number
<optional> default: 250
|
|
|
Returns
discoverCommandsGenerated
(async) discoverCommandsGenerated(optionsopt): Promise.<{commandIds: Array.<number>, lastResponse: boolean}>This method handles an incoming discoverCommandsGenerated
command send from the remote node
to the controller. It assembles the cluster's commands which are implemented on this bound
cluster (i.e. commands it can send).
Parameters
Name | Type | Description |
---|---|---|
options
|
object
<optional> |
|
startValue
|
number
<optional> default: 0
|
|
maxResults
|
number
<optional> default: 250
|
|
|
Returns
discoverCommandsReceived
(async) discoverCommandsReceived(optionsopt): Promise.<{commandIds: Array.<number>, lastResponse: boolean}>This method handles an incoming discoverCommandsReceived
command send from the remote node
to the controller. It assembles the cluster's commands which are implemented on this bound
cluster (i.e. commands it can receive) and returns a response to the remote node.
Parameters
Name | Type | Description |
---|---|---|
options
|
object
<optional> |
|
startValue
|
number
<optional> default: 0
|
|
maxResults
|
number
<optional> default: 250
|
|
|
Returns
readAttributes
(async) readAttributes(options): Promise.<{attributes: Buffer}>This method handles an incoming readAttributes
command send from the remote node
to the controller. It assembles attribute values by reading this[attr.name]
for all
supported attributes of this cluster and sends the response to the remote node.
Parameters
Name | Type | Description |
---|---|---|
options
|
object | |
attributes
|
Array.<string> | |
|
Returns
writeAttributes
(async) writeAttributes(optionsopt): Promise.<{attributes}>This method handles an incoming writeAttributes
command send from the remote node
to the controller. It sets the received attribute values on this[attr.name]
and returns a
response to the remote node.
Parameters
Name | Type | Description |
---|---|---|
options
|
object
<optional> |
|
attributes
|
Array.<object> | |
|