Class Gateway
java.lang.Object
org.openremote.agent.protocol.tradfri.device.Gateway
The class that is used to communicate with the IKEA TRÃ…DFRI gateway
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventHandler(EventHandler<?> eventHandler) Add an event handler to the IKEA TRÃ…DFRI gatewayConnect and authenticate to the IKEA TRÃ…DFRI gateway using a security codeconnect(Credentials credentials) Connect and authenticate to the IKEA TRÃ…DFRI gateway using credentialsbooleanDisable observebooleanEnable observe to automagically detect changes to the deviceGet the credentials used to communicate with the IKEA TRÃ…DFRI gatewaygetDevice(int id) Get the a device registered to the IKEA TRÃ…DFRI gatewayint[]Get the ids of the devices registered to the IKEA TRÃ…DFRI gatewayDevice[]Get the devices registered to the IKEA TRÃ…DFRI gatewayList<EventHandler<?>>Get a list of event handlers for the IKEA TRÃ…DFRI gatewaylongGet timeout for connections to the IKEA TRÃ…DFRI gateway (in milliseconds)voidremoveEventHandler(EventHandler<?> eventHandler) Remove an event handler from the IKEA TRÃ…DFRI gatewayvoidsetCredentials(String identity, String key) Change the credentials used to communicate with the IKEA TRÃ…DFRI gatewayvoidsetCredentials(Credentials credentials) Change the credentials used to communicate with the IKEA TRÃ…DFRI gatewayvoidsetTimeout(long timeout) Change the timeout for connections to the IKEA TRÃ…DFRI gateway (in milliseconds)
-
Constructor Details
-
Gateway
Construct the Gateway class- Parameters:
ip- The IP-address of the IKEA TRÃ…DFRI gateway
-
-
Method Details
-
connect
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
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
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
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 gatewaykey- The new key that can be used to authenticate to the IKEA TRÃ…DFRI gateway
-
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
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
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
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
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
Remove an event handler from the IKEA TRÃ…DFRI gateway- Parameters:
eventHandler- The event handler to remove from the IKEA TRÃ…DFRI gateway
-