Class Plug
java.lang.Object
org.openremote.agent.protocol.tradfri.device.Device
org.openremote.agent.protocol.tradfri.device.Plug
The class that represents an IKEA TRÃ…DFRI plug
-
Field Summary
Fields inherited from class org.openremote.agent.protocol.tradfri.device.Device
coapClient -
Constructor Summary
ConstructorsConstructorDescriptionPlug(String name, Long creationDate, Integer instanceId, DeviceInfo deviceInfo, PlugProperties properties, CoapClient coapClient) Construct the Plug class -
Method Summary
Modifier and TypeMethodDescriptionbooleanApply the updates in the update queue to the pluggetOn()Get the on / off state of the plugGet the properties of the plugbooleanSet the on / off state of the plugvoidsetProperties(DeviceProperties properties) Set the properties of the plugvoidUpdate the on / off state of the plug in the update queueMethods inherited from class org.openremote.agent.protocol.tradfri.device.Device
addEventHandler, disableObserve, enableObserve, getCreationDate, getDeviceInfo, getEndpoint, getEventHandlers, getInstanceId, getName, isLight, isPlug, removeEventHandler, setCreationDate, setInstanceId, setName, toLight, toPlug
-
Constructor Details
-
Plug
public Plug(String name, Long creationDate, Integer instanceId, DeviceInfo deviceInfo, PlugProperties properties, CoapClient coapClient) Construct the Plug class- Parameters:
name- The name of the plugcreationDate- The creation date of the pluginstanceId- The instance id of the plugdeviceInfo- The information of the deviceproperties- The properties of the plugcoapClient- A CoAP client that can be used to communicate with the plug using the IKEA TRÃ…DFRI gateway
-
-
Method Details
-
getProperties
Get the properties of the plug- Overrides:
getPropertiesin classDevice- Returns:
- The properties of the plug
-
setProperties
Set the properties of the plug- Overrides:
setPropertiesin classDevice- Parameters:
properties- The properties of the plug
-
getOn
Get the on / off state of the plug- Returns:
- The on state of the plug (true for on, false for off)
-
updateOn
Update the on / off state of the plug in the update queue- Parameters:
on- The new on / off state for the plug (true for on, false for off)
-
setOn
Set the on / off state of the plug- Parameters:
on- The new on / off state for the plug (true for on, false for off)- Returns:
- True if successfully updated the plug, false if not
-
applyUpdates
public boolean applyUpdates()Apply the updates in the update queue to the plug- Returns:
- True if successfully updated the plug, false if not
-