Example #1
0
 /**
  * Called when an openhab command arrives for this device feature
  *
  * @param c the binding config of the item which sends the command
  * @param cmd the command to be exectued
  */
 public void handleCommand(InsteonPLMBindingConfig c, Command cmd) {
   Class<? extends Command> key = cmd.getClass();
   CommandHandler h =
       m_commandHandlers.containsKey(key) ? m_commandHandlers.get(key) : m_defaultCommandHandler;
   logger.trace(
       "{} uses {} to handle command {} for {}",
       getName(),
       h.getClass().getSimpleName(),
       key.getSimpleName(),
       getDevice().getAddress());
   h.handleCommand(c, cmd, getDevice());
 }
Example #2
0
 @Override
 void setParameters(HashMap<String, String> params) {
   super.setParameters(params);
   onCmd = (byte) getIntParameter("on", 0x2E);
   offCmd = (byte) getIntParameter("off", 0x2F);
 }