java.lang.Object
org.openremote.agent.protocol.tradfri.device.Device
org.openremote.agent.protocol.tradfri.device.Plug

public class Plug extends Device
The class that represents an IKEA TRÃ…DFRI plug
  • 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 plug
      creationDate - The creation date of the plug
      instanceId - The instance id of the plug
      deviceInfo - The information of the device
      properties - The properties of the plug
      coapClient - A CoAP client that can be used to communicate with the plug using the IKEA TRÃ…DFRI gateway
  • Method Details

    • getProperties

      public PlugProperties getProperties()
      Get the properties of the plug
      Overrides:
      getProperties in class Device
      Returns:
      The properties of the plug
    • setProperties

      public void setProperties(DeviceProperties properties)
      Set the properties of the plug
      Overrides:
      setProperties in class Device
      Parameters:
      properties - The properties of the plug
    • getOn

      public Boolean getOn()
      Get the on / off state of the plug
      Returns:
      The on state of the plug (true for on, false for off)
    • updateOn

      public void updateOn(Boolean on)
      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

      public boolean setOn(Boolean on)
      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