public class ZigbeeDevice extends Device
Constructor and Description |
---|
ZigbeeDevice(com.mmbnetworks.rotarrandevicemodel.DeviceModel deviceModel,
DeviceConnectionType deviceConnectionType,
com.mmbnetworks.dialogues.DialogueManager dialogueManager,
Executor clientExecutor) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<String> |
enableDefaultReporting()
Configures the device to report changes to its properties to the
GatewayClient to which it is connected.
|
DeviceType |
getDeviceType()
Get the
DeviceType associated with the Device. |
CompletableFuture<String> |
getHardwareVersion()
Retrieves the Hardware Version Of This Device.
|
CompletableFuture<String> |
getManufacturerName()
Retrieves the Manufacturer Name Of This Device.
|
CompletableFuture<String> |
getModelNumber()
Retrieves the Model Identifier Of This Device.
|
CompletableFuture<Property> |
readAttribute(int clusterId,
int attributeId)
Read a zigbee attribute that lives on a server cluster (and is not manufacturing specific).
|
CompletableFuture<Property> |
readAttribute(int clusterId,
int attributeId,
int manufacturerCode,
boolean isServer)
Read a zigbee attribute.
|
CompletableFuture<Property> |
sendZclCommand(short commandId,
byte[] payload,
int clusterId)
Sends a zcl general command to a server cluster (that is not manufacturing specific).
|
CompletableFuture<Property> |
sendZclCommand(short commandId,
byte[] payload,
int clusterId,
int manufacturerCode,
boolean isServer,
boolean isClusterSpecific)
Sends a zcl command.
|
CompletableFuture<Property> |
writeAttribute(int clusterId,
int attributeId,
short dataType,
byte[] value)
Write to a zigbee attribute that lives on a server cluster (and is not manufacturing specific).
|
CompletableFuture<Property> |
writeAttribute(int clusterId,
int attributeId,
short dataType,
byte[] value,
int manufacturerCode,
boolean isServer)
Write to a zigbee attribute.
|
accept, accept, addPropertyUpdateHandler, addProtocolHandler, addToGroup, bindDevice, callFunction, configureReporting, discoverAllProperties, getCachedProperties, getCachedProperty, getCachedProtocolProperties, getConnectedGatewayId, getDeviceConnectionType, getID, getProperties, getProperty, getProtocolProperties, leaveNetwork, ping, removeAllPropertyUpdateHandlers, removeAllProtocolHandlers, removeFromGroup, removePropertyUpdateHandler, removeProtocolHandler, sendProtocolMessage, unbindDevice, updateProperty
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
andThen
public ZigbeeDevice(com.mmbnetworks.rotarrandevicemodel.DeviceModel deviceModel, DeviceConnectionType deviceConnectionType, com.mmbnetworks.dialogues.DialogueManager dialogueManager, Executor clientExecutor)
public DeviceType getDeviceType()
DeviceType
associated with the Device.
For zigbee devices, this will include the device profile name, and the
device type (i.e. Lighting, Dimmable Light).getDeviceType
in class Device
DeviceType
object.public CompletableFuture<String> enableDefaultReporting() throws IllegalStateException
Device
enableDefaultReporting
in class Device
IllegalStateException
- if the function is called before
the device Properties have been discovered (i.e. through getProperties()).public CompletableFuture<Property> readAttribute(int clusterId, int attributeId)
clusterId
- The cluster on which the attribute exists.attributeId
- The attribute to read.public CompletableFuture<Property> readAttribute(int clusterId, int attributeId, int manufacturerCode, boolean isServer)
clusterId
- The cluster on which the attribute exists.attributeId
- The attribute to readmanufacturerCode
- The manufacturer code. 0 means "not manufacturer specific".isServer
- Whether it's a server cluster.public CompletableFuture<Property> writeAttribute(int clusterId, int attributeId, short dataType, byte[] value)
clusterId
- The cluster on which the attribute lives.attributeId
- The attribute to write to.dataType
- The zigbee data type of the attribute.value
- The value as a byte array. The value should be entered in LSB; example the number 2700 is entered as { (byte)0x8c, (byte)0x0a }.public CompletableFuture<Property> writeAttribute(int clusterId, int attributeId, short dataType, byte[] value, int manufacturerCode, boolean isServer)
clusterId
- The cluster on which the attribute lives.attributeId
- The attribute to write to.dataType
- The zigbee data type of the attribute.value
- The value as a byte array. The value should be entered in LSB; example the number 2700 is entered as { (byte)0x8c, (byte)0x0a }.manufacturerCode
- The manufacturer code. 0 means "not manufacturer specific".isServer
- Whether the cluster is a server cluster.public CompletableFuture<Property> sendZclCommand(short commandId, byte[] payload, int clusterId)
commandId
- The zcl command id.payload
- The payload in bytes. Each field in the payload is entered as LSB, so 2700 would be 8c 0a.clusterId
- The cluster to send the command to.public CompletableFuture<Property> sendZclCommand(short commandId, byte[] payload, int clusterId, int manufacturerCode, boolean isServer, boolean isClusterSpecific)
commandId
- The zcl command id.payload
- The payload in bytes. Each field in the payload is entered as LSB, so 2700 would be 8c 0a.clusterId
- The cluster to send the command to.manufacturerCode
- The manufacturer code. 0 means "not manufacturing specific".isServer
- Whether the cluster is a server cluster.isClusterSpecific
- Whether the command is cluster specific (as opposed to a zcl general command).public CompletableFuture<String> getManufacturerName()
CompletableFuture
object will return immediately with the cached valuegetManufacturerName
in class Device
CompletableFuture
object. It will contain the manufacturer name if it exists.public CompletableFuture<String> getHardwareVersion()
CompletableFuture
object will return immediately with the cached valuegetHardwareVersion
in class Device
CompletableFuture
object. It will contain the hardware version if it exists.public CompletableFuture<String> getModelNumber()
CompletableFuture
object will return immediately with the cached valuegetModelNumber
in class Device
CompletableFuture
object. It will contain the model identifier if it exists.Copyright © 2019. All rights reserved.