Class 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 Details

    • PROTOCOL_DISPLAY_NAME

      public static final String PROTOCOL_DISPLAY_NAME
      See Also:
    • LOG

      public static final Logger LOG
    • network

      protected ZWaveNetwork network
    • sensorValueConsumerMap

      protected Map<org.openremote.model.attribute.AttributeRef,Consumer<org.openremote.protocol.zwave.model.commandclasses.channel.value.Value>> sensorValueConsumerMap
  • Constructor Details

    • ZWaveProtocol

      public ZWaveProtocol(ZWaveAgent agent)
  • Method Details

    • getProtocolName

      public String getProtocolName()
      Description copied from interface: org.openremote.model.asset.agent.Protocol
      Get the name for this protocol
      Specified by:
      getProtocolName in interface org.openremote.model.asset.agent.Protocol<ZWaveAgent>
    • getProtocolInstanceUri

      public String getProtocolInstanceUri()
      Description copied from interface: org.openremote.model.asset.agent.Protocol
      Get a URI that describes this specific protocol instance
      Specified by:
      getProtocolInstanceUri in interface org.openremote.model.asset.agent.Protocol<ZWaveAgent>
    • doStart

      protected void doStart(org.openremote.model.Container container) throws Exception
      Description copied from class: AbstractProtocol
      Start this protocol instance
      Specified by:
      doStart in class AbstractProtocol<ZWaveAgent,ZWaveAgentLink>
      Throws:
      Exception
    • doStop

      protected void doStop(org.openremote.model.Container container) throws Exception
      Description copied from class: AbstractProtocol
      Stop this protocol instance
      Specified by:
      doStop in class AbstractProtocol<ZWaveAgent,ZWaveAgentLink>
      Throws:
      Exception
    • doLinkAttribute

      protected void doLinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, ZWaveAgentLink agentLink)
      Description copied from class: AbstractProtocol
      Link an Attribute to its linked Agent.
      Specified by:
      doLinkAttribute in class AbstractProtocol<ZWaveAgent,ZWaveAgentLink>
    • doUnlinkAttribute

      protected void doUnlinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, ZWaveAgentLink agentLink)
      Description copied from class: AbstractProtocol
      Unlink an Attribute from its linked Agent.
      Specified by:
      doUnlinkAttribute in class AbstractProtocol<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 (see ProtocolUtil.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 class AbstractProtocol<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 become Future.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 interface org.openremote.model.protocol.ProtocolAssetDiscovery