Class MagicActionModuleThingHandler

java.lang.Object
org.openhab.core.thing.binding.BaseThingHandler
org.openhab.core.magic.binding.handler.MagicActionModuleThingHandler
All Implemented Interfaces:
ThingHandler

@NonNullByDefault public class MagicActionModuleThingHandler extends BaseThingHandler
ThingHandler which provides annotated actions that will become Action modules for the automation engine
Author:
Stefan Triller - Initial contribution
  • Constructor Details

    • MagicActionModuleThingHandler

      public MagicActionModuleThingHandler(Thing thing)
  • Method Details

    • initialize

      public void initialize()
      Description copied from interface: ThingHandler
      Initializes the thing handler, e.g. update thing status, allocate resources, transfer configuration.

      This method is only called, if the Thing contains all required configuration parameters.

      Only Things with status ThingStatus.UNKNOWN, ThingStatus.ONLINE or ThingStatus.OFFLINE are considered as initialized by the framework. To achieve that, the status must be reported via ThingHandlerCallback.statusUpdated(Thing, ThingStatusInfo).

      The framework expects this method to be non-blocking and return quickly. For longer running initializations, the implementation has to take care of scheduling a separate job which must guarantee to set the thing status eventually.

      Any anticipated error situations should be handled gracefully and need to result in ThingStatus.OFFLINE with the corresponding status detail (e.g. *COMMUNICATION_ERROR* or *CONFIGURATION_ERROR* including a meaningful description) instead of throwing exceptions.

    • handleCommand

      public void handleCommand(ChannelUID channelUID, Command command)
      Description copied from interface: ThingHandler
      Handles a command for a given channel.

      This method is only called, if the thing has been initialized (status ONLINE/OFFLINE/UNKNOWN).

      Parameters:
      channelUID - the ChannelUID of the channel to which the command was sent
      command - the Command
    • communicateActionToDevice

      public void communicateActionToDevice(String doSomething)
    • getServices

      public Collection<Class<? extends ThingHandlerService>> getServices()
      Description copied from interface: ThingHandler
      This method provides a list of classes which should be registered as services by the framework
      Returns:
      - list of classes that will be registered as OSGi services