Class TradfriConnection

java.lang.Object
org.openremote.agent.protocol.tradfri.TradfriConnection

public class TradfriConnection extends Object
The class that represents the configuration for the IKEA TRÅDFRI connection.
  • Field Details

    • connectionStatus

      protected org.openremote.model.asset.agent.ConnectionStatus connectionStatus
      The connection status, the default is disconnected
    • connectionStatusConsumers

      protected final List<Consumer<org.openremote.model.asset.agent.ConnectionStatus>> connectionStatusConsumers
      The connection status consumers of the IKEA TRÅDFRI connection
    • gatewayIp

      protected final String gatewayIp
      The IP address of the gateway
    • securityCode

      protected final String securityCode
      The security code that's needed to connect to the gateway.
  • Constructor Details

    • TradfriConnection

      public TradfriConnection(String gatewayIp, String securityCode)
      Construct the TradfriConnection class.
      Parameters:
      gatewayIp - the IP address of the gateway.
      securityCode - the security code to connect to the gateway.
  • Method Details

    • connect

      public Gateway connect()
      Handles the connection.
      Returns:
      the gateway.
    • onConnectionStatusChanged

      protected void onConnectionStatusChanged(org.openremote.model.asset.agent.ConnectionStatus connectionStatus)
      Updates the connection status.
      Parameters:
      connectionStatus - the connection status.
    • addConnectionStatusConsumer

      public void addConnectionStatusConsumer(Consumer<org.openremote.model.asset.agent.ConnectionStatus> connectionStatusConsumer)
      Adds a connection status consumer.
      Parameters:
      connectionStatusConsumer - the connection status consumer.
    • disconnect

      public void disconnect()
      Handles the disconnection.
    • removeConnectionStatusConsumer

      public void removeConnectionStatusConsumer(Consumer<org.openremote.model.asset.agent.ConnectionStatus> connectionStatusConsumer)
      Removes the connection status consumer.
      Parameters:
      connectionStatusConsumer - the connection status consumer.
    • controlDevice

      public void controlDevice(Device device, org.openremote.model.attribute.AttributeEvent event)
      Method to update the values of the device attributes, based on the values entered in the User Interface.
      Parameters:
      device - the device to which the update applies.
      event - the event representing the update.