Class ZWaveProtocol
java.lang.Object
org.openremote.agent.protocol.AbstractProtocol<ZWaveAgent,ZWaveAgentLink>
org.openremote.agent.protocol.zwave.ZWaveProtocol
- All Implemented Interfaces:
org.openremote.model.asset.agent.Protocol<ZWaveAgent>
,org.openremote.model.protocol.ProtocolAssetDiscovery
public class ZWaveProtocol
extends AbstractProtocol<ZWaveAgent,ZWaveAgentLink>
implements org.openremote.model.protocol.ProtocolAssetDiscovery
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Logger
protected ZWaveNetwork
static final String
protected Map
<org.openremote.model.attribute.AttributeRef, Consumer<org.openremote.protocol.zwave.model.commandclasses.channel.value.Value>> Fields inherited from class org.openremote.agent.protocol.AbstractProtocol
agent, assetService, datapointService, dynamicAttributes, executorService, linkedAttributes, messageBrokerContext, predictedDatapointService, processorLock, producerTemplate, scheduledExecutorService, timerService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doLinkAttribute
(String assetId, org.openremote.model.attribute.Attribute<?> attribute, ZWaveAgentLink agentLink) Link anAttribute
to its linkedAgent
.protected void
doLinkedAttributeWrite
(ZWaveAgentLink agentLink, org.openremote.model.attribute.AttributeEvent event, Object processedValue) An Attribute event (write) has been requested for an attribute linked to this protocol.protected void
doStart
(org.openremote.model.Container container) Start this protocol instanceprotected void
doStop
(org.openremote.model.Container container) Stop this protocol instanceprotected void
doUnlinkAttribute
(String assetId, org.openremote.model.attribute.Attribute<?> attribute, ZWaveAgentLink agentLink) Unlink anAttribute
from its linkedAgent
.Get a URI that describes this specific protocol instanceGet the name for this protocolstartAssetDiscovery
(Consumer<org.openremote.model.asset.AssetTreeNode[]> assetConsumer) Start the process asynchronously; the implementation can make as many calls as it desires to the assetConsumer with the found assets; when the implementation has finished then the returned future will becomeFuture.isDone()
.Methods inherited from class org.openremote.agent.protocol.AbstractProtocol
getAgent, getLinkedAttributes, linkAttribute, onAgentAttributeChanged, processLinkedAttributeWrite, sendAttributeEvent, sendAttributeEvent, setAssetService, setConnectionStatus, start, stop, toString, unlinkAttribute, updateLinkedAttribute, updateLinkedAttribute
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.openremote.model.asset.agent.Protocol
prefixLogMessage
-
Field Details
-
PROTOCOL_DISPLAY_NAME
- See Also:
-
LOG
-
network
-
sensorValueConsumerMap
-
-
Constructor Details
-
ZWaveProtocol
-
-
Method Details
-
getProtocolName
Description copied from interface:org.openremote.model.asset.agent.Protocol
Get the name for this protocol- Specified by:
getProtocolName
in interfaceorg.openremote.model.asset.agent.Protocol<ZWaveAgent>
-
getProtocolInstanceUri
Description copied from interface:org.openremote.model.asset.agent.Protocol
Get a URI that describes this specific protocol instance- Specified by:
getProtocolInstanceUri
in interfaceorg.openremote.model.asset.agent.Protocol<ZWaveAgent>
-
doStart
Description copied from class:AbstractProtocol
Start this protocol instance- Specified by:
doStart
in classAbstractProtocol<ZWaveAgent,
ZWaveAgentLink> - Throws:
Exception
-
doStop
Description copied from class:AbstractProtocol
Stop this protocol instance- Specified by:
doStop
in classAbstractProtocol<ZWaveAgent,
ZWaveAgentLink> - Throws:
Exception
-
doLinkAttribute
protected void doLinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, ZWaveAgentLink agentLink) Description copied from class:AbstractProtocol
Link anAttribute
to its linkedAgent
.- Specified by:
doLinkAttribute
in classAbstractProtocol<ZWaveAgent,
ZWaveAgentLink>
-
doUnlinkAttribute
protected void doUnlinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, ZWaveAgentLink agentLink) Description copied from class:AbstractProtocol
Unlink anAttribute
from its linkedAgent
.- Specified by:
doUnlinkAttribute
in classAbstractProtocol<ZWaveAgent,
ZWaveAgentLink>
-
doLinkedAttributeWrite
protected void doLinkedAttributeWrite(ZWaveAgentLink agentLink, org.openremote.model.attribute.AttributeEvent event, Object processedValue) Description copied from class:AbstractProtocol
An Attribute event (write) has been requested for an attribute linked to this protocol. The processedValue is the resulting value after applying standard outbound value processing (seeProtocolUtil.doOutboundValueProcessing(org.openremote.model.attribute.AttributeRef, org.openremote.model.asset.agent.AgentLink<?>, java.lang.Object, boolean, java.time.Instant)
). Protocol implementations should generally use the processedValue but may also choose to use the original value for some purpose if required.- Specified by:
doLinkedAttributeWrite
in classAbstractProtocol<ZWaveAgent,
ZWaveAgentLink>
-
startAssetDiscovery
public Future<Void> startAssetDiscovery(Consumer<org.openremote.model.asset.AssetTreeNode[]> assetConsumer) Description copied from interface:org.openremote.model.protocol.ProtocolAssetDiscovery
Start the process asynchronously; the implementation can make as many calls as it desires to the assetConsumer with the found assets; when the implementation has finished then the returned future will becomeFuture.isDone()
. The callee can also cancel the future at any time. If for some reason the process cannot be started or encounters an error then this method should log more details before completing the future.- Specified by:
startAssetDiscovery
in interfaceorg.openremote.model.protocol.ProtocolAssetDiscovery
-