Class TradfriProtocol

java.lang.Object
org.openremote.agent.protocol.AbstractProtocol<TradfriAgent,org.openremote.model.asset.agent.DefaultAgentLink>
org.openremote.agent.protocol.tradfri.TradfriProtocol
All Implemented Interfaces:
org.openremote.model.asset.agent.Protocol<TradfriAgent>

public class TradfriProtocol extends AbstractProtocol<TradfriAgent,org.openremote.model.asset.agent.DefaultAgentLink>
Protocol for communicating with the IKEA TRÅDFRI gateway; devices are represented as Assets under the linked Agent; Assets are automatically added/removed depending on whether they are available on the gateway, for a given Agent a device Asset will have a consistent ID.
  • Field Details

  • Constructor Details

    • TradfriProtocol

      public TradfriProtocol(TradfriAgent agent)
  • Method Details

    • getProtocolName

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

      public String getProtocolInstanceUri()
      Description copied from interface: org.openremote.model.asset.agent.Protocol
      Get a URI that describes this specific protocol instance
    • 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<TradfriAgent,org.openremote.model.asset.agent.DefaultAgentLink>
      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<TradfriAgent,org.openremote.model.asset.agent.DefaultAgentLink>
      Throws:
      Exception
    • doLinkAttribute

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

      protected void doUnlinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, org.openremote.model.asset.agent.DefaultAgentLink agentLink)
      Description copied from class: AbstractProtocol
      Unlink an Attribute from its linked Agent.
      Specified by:
      doUnlinkAttribute in class AbstractProtocol<TradfriAgent,org.openremote.model.asset.agent.DefaultAgentLink>
    • doLinkedAttributeWrite

      protected void doLinkedAttributeWrite(org.openremote.model.asset.agent.DefaultAgentLink 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<TradfriAgent,org.openremote.model.asset.agent.DefaultAgentLink>
    • synchroniseAssets

      protected void synchroniseAssets(Device[] devices)
    • addDevice

      protected void addDevice(TradfriAsset asset, Device device)
    • removeDevice

      protected void removeDevice(String assetId)
    • getDeviceAssetId

      protected String getDeviceAssetId(Device device)