java.lang.Object
org.openremote.agent.protocol.tradfri.device.Gateway

public class Gateway extends Object
The class that is used to communicate with the IKEA TRÃ…DFRI gateway
  • Constructor Details

    • Gateway

      public Gateway(String ip)
      Construct the Gateway class
      Parameters:
      ip - The IP-address of the IKEA TRÃ…DFRI gateway
  • Method Details

    • connect

      public Credentials connect(String securityCode)
      Connect and authenticate to the IKEA TRÃ…DFRI gateway using a security code
      Parameters:
      securityCode - The security code of the IKEA TRÃ…DFRI gateway
      Returns:
      Credentials that can be used to authenticate to the IKEA TRÃ…DFRI gateway
    • connect

      public Credentials connect(Credentials credentials)
      Connect and authenticate to the IKEA TRÃ…DFRI gateway using credentials
      Parameters:
      credentials - The credentials that can be used to authenticate to the IKEA TRÃ…DFRI gateway
      Returns:
      Credentials that can be used to authenticate to the IKEA TRÃ…DFRI gateway
    • setCredentials

      public void setCredentials(Credentials credentials)
      Change the credentials used to communicate with the IKEA TRÃ…DFRI gateway
      Parameters:
      credentials - The new credentials that can be used to authenticate to the IKEA TRÃ…DFRI gateway
    • setCredentials

      public void setCredentials(String identity, String key)
      Change the credentials used to communicate with the IKEA TRÃ…DFRI gateway
      Parameters:
      identity - The new identity that can be used to authenticate to the IKEA TRÃ…DFRI gateway
      key - The new key that can be used to authenticate to the IKEA TRÃ…DFRI gateway
    • getCredentials

      public Credentials getCredentials()
      Get the credentials used to communicate with the IKEA TRÃ…DFRI gateway
      Returns:
      The credentials that can be used to authenticate to the IKEA TRÃ…DFRI gateway
    • getTimeout

      public long getTimeout()
      Get timeout for connections to the IKEA TRÃ…DFRI gateway (in milliseconds)
      Returns:
      The timeout for connections to the IKEA TRÃ…DFRI gateway (in milliseconds)
    • setTimeout

      public void setTimeout(long timeout)
      Change the timeout for connections to the IKEA TRÃ…DFRI gateway (in milliseconds)
      Parameters:
      timeout - The new timeout for connections to the IKEA TRÃ…DFRI gateway (in milliseconds)
    • getDeviceIds

      public int[] getDeviceIds()
      Get the ids of the devices registered to the IKEA TRÃ…DFRI gateway
      Returns:
      An array of the ids of the devices registered to the IKEA TRÃ…DFRI gateway
    • getDevice

      public Device getDevice(int id)
      Get the a device registered to the IKEA TRÃ…DFRI gateway
      Parameters:
      id - The id of a device registered to the IKEA TRÃ…DFRI gateway
      Returns:
      The device with the provided id
    • getDevices

      public Device[] getDevices()
      Get the devices registered to the IKEA TRÃ…DFRI gateway
      Returns:
      An array of the devices registered to the IKEA TRÃ…DFRI gateway
    • enableObserve

      public boolean enableObserve()
      Enable observe to automagically detect changes to the device
      Returns:
      True if successfully enabled observe, false if not
    • disableObserve

      public boolean disableObserve()
      Disable observe
      Returns:
      True if successfully disabled observe, false if not
    • getEventHandlers

      public List<EventHandler<?>> getEventHandlers()
      Get a list of event handlers for the IKEA TRÃ…DFRI gateway
      Returns:
      A list of event handlers for the IKEA TRÃ…DFRI gateway
    • addEventHandler

      public void addEventHandler(EventHandler<?> eventHandler)
      Add an event handler to the IKEA TRÃ…DFRI gateway
      Parameters:
      eventHandler - The event handler to add to the IKEA TRÃ…DFRI gateway
      Since:
      1.0.0
    • removeEventHandler

      public void removeEventHandler(EventHandler<?> eventHandler)
      Remove an event handler from the IKEA TRÃ…DFRI gateway
      Parameters:
      eventHandler - The event handler to remove from the IKEA TRÃ…DFRI gateway