Class TradfriConnection
java.lang.Object
org.openremote.agent.protocol.tradfri.TradfriConnection
The class that represents the configuration for the IKEA TRÃ…DFRI connection.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.openremote.model.asset.agent.ConnectionStatusThe connection status, the default is disconnectedThe connection status consumers of the IKEA TRÃ…DFRI connectionprotected final ScheduledExecutorServiceThe executor service of the IKEA TRÃ…DFRI connectionprotected final StringThe IP address of the gatewayprotected final StringThe security code that's needed to connect to the gateway. -
Constructor Summary
ConstructorsConstructorDescriptionTradfriConnection(String gatewayIp, String securityCode, ScheduledExecutorService executorService) Construct the TradfriConnection class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnectionStatusConsumer(Consumer<org.openremote.model.asset.agent.ConnectionStatus> connectionStatusConsumer) Adds a connection status consumer.connect()Handles the connection.voidcontrolDevice(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.voidHandles the disconnection.protected voidonConnectionStatusChanged(org.openremote.model.asset.agent.ConnectionStatus connectionStatus) Updates the connection status.voidremoveConnectionStatusConsumer(Consumer<org.openremote.model.asset.agent.ConnectionStatus> connectionStatusConsumer) Removes the connection status consumer.
-
Field Details
-
connectionStatus
protected org.openremote.model.asset.agent.ConnectionStatus connectionStatusThe connection status, the default is disconnected -
connectionStatusConsumers
protected final List<Consumer<org.openremote.model.asset.agent.ConnectionStatus>> connectionStatusConsumersThe connection status consumers of the IKEA TRÃ…DFRI connection -
executorService
The executor service of the IKEA TRÃ…DFRI connection -
gatewayIp
The IP address of the gateway -
securityCode
The security code that's needed to connect to the gateway.
-
-
Constructor Details
-
TradfriConnection
public TradfriConnection(String gatewayIp, String securityCode, ScheduledExecutorService executorService) Construct the TradfriConnection class.- Parameters:
gatewayIp- the IP address of the gateway.securityCode- the security code to connect to the gateway.executorService- the executor service.
-
-
Method Details
-
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
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.
-