Ejemplo n.º 1
0
 /**
  * This method does the pressKey for a list of commands with a given delay between the commands.
  *
  * @see com.comcast.cats.provider.RemoteProvider#pressKeys(java.util.List, java.lang.Integer)
  */
 @Override
 public boolean pressKeys(List<RemoteCommand> commands, Integer delay) {
   String commandStr = "";
   for (RemoteCommand command : commands) {
     commandStr = commandStr + "," + command.name();
   }
   return sleepOnTrue(irRest.pressKeys(keySet, commandStr, delay));
 }
Ejemplo n.º 2
0
 /**
  * This method lists all the remote types available
  *
  * @see com.comcast.cats.provider.RemoteProvider#getAllRemoteTypes()
  */
 @Override
 public List<String> getAllRemoteTypes() {
   List<Remote> remotes = irRest.getRemotes();
   List<String> remoteTypes = new ArrayList<String>();
   for (Remote remote : remotes) {
     remoteTypes.add(remote.getName());
   }
   return remoteTypes;
 }
Ejemplo n.º 3
0
 /**
  * This method does the pressKey for a particular command with a repeat count
  *
  * @see
  *     com.comcast.cats.provider.RemoteProvider#pressKey(java.lang.Integer,com.comcast.cats.RemoteCommand)
  */
 @Override
 public boolean pressKey(Integer count, RemoteCommand command) {
   boolean returnValue = true;
   for (int index = 0; index < count; index++) {
     returnValue = sleepOnTrue(irRest.pressKey(keySet, command.toString()));
     if (!returnValue) {
       break;
     }
   }
   return returnValue;
 }
Ejemplo n.º 4
0
  /**
   * This method takes a list of remote command sequences.
   *
   * @see com.comcast.cats.provider.RemoteProvider#enterRemoteCommandSequence(java.util.List)
   */
  @Override
  public boolean enterRemoteCommandSequence(List<RemoteCommandSequence> commands) {

    List<String> commandList = new ArrayList<String>();

    for (RemoteCommandSequence remCommand : commands) {
      String command = remCommand.getCommand().name();
      command = command + "," + remCommand.getRepeatCount();
      command = command + "," + remCommand.getDelay();
      commandList.add(command);
    }

    return sleepOnTrue(irRest.enterRemoteCommandSequence(keySet, commandList));
  }
Ejemplo n.º 5
0
 /**
  * This method takes a list of Remote commands, list of repeat counts and list of delays between
  * each remote command.
  *
  * @see com.comcast.cats.provider.RemoteProvider#enterCustomKeySequence(java.util.List,
  *     java.util.List, java.util.List)
  */
 @Override
 public boolean enterCustomKeySequence(
     List<RemoteCommand> commands, List<Integer> repeatCount, List<Integer> delay) {
   String commandStr = "";
   for (RemoteCommand command : commands) {
     commandStr = commandStr + "," + command.name();
   }
   String delayStr = "";
   for (Integer delayInt : delay) {
     delayStr = delayStr + "," + delayInt;
   }
   String countStr = "";
   for (Integer cnt : repeatCount) {
     countStr = countStr + "," + cnt;
   }
   return sleepOnTrue(irRest.enterCustomKeySequence(keySet, commandStr, delayStr, countStr));
 }
Ejemplo n.º 6
0
 /**
  * This method is to send the IR code. Note that the code is sent as the payload of the REST
  * request.
  *
  * @param irCode - the raw IR code string
  * @return true/false
  */
 public boolean sendIR(String irCode) {
   return irRest.sendIR(irCode);
 }
Ejemplo n.º 7
0
 /**
  * This method tunes the channel (given in integer format)
  *
  * @see com.comcast.cats.provider.RemoteProvider#tune(java.lang.Integer)
  */
 @Override
 public boolean tune(Integer channel) {
   return irRest.tune(
       keySet, String.valueOf(channel), String.valueOf(autoTuneEnabled), String.valueOf(delay));
 }
Ejemplo n.º 8
0
 /**
  * This method sends text. Note that the text has to be a numeric string.
  *
  * @see com.comcast.cats.provider.RemoteProvider#sendText(java.lang.String)
  */
 @Override
 public boolean sendText(String text) {
   return irRest.sendText(keySet, text);
 }
Ejemplo n.º 9
0
 /**
  * This method does the pressKey for a command and holds it for count time.
  *
  * @see com.comcast.cats.provider.RemoteProvider#pressKeyAndHold(com.comcast.cats.RemoteCommand,
  *     java.lang.Integer)
  */
 @Override
 public boolean pressKeyAndHold(RemoteCommand command, Integer count) {
   return irRest.pressKeyAndHold(keySet, command.toString(), String.valueOf(count));
 }
Ejemplo n.º 10
0
 /**
  * This method does the pressKey for an integer command
  *
  * @see com.comcast.cats.provider.RemoteProvider#pressKey(java.lang.Integer)
  */
 @Override
 public boolean pressKey(Integer command) {
   return sleepOnTrue(irRest.pressKey(keySet, String.valueOf(command)));
 }
Ejemplo n.º 11
0
 /**
  * This method does the pressKey for a particular command with a specific delay
  *
  * @see
  *     com.comcast.cats.provider.RemoteProvider#pressKey(com.comcast.cats.RemoteCommand,java.lang.Integer)
  */
 @Override
 public boolean pressKey(RemoteCommand command, Integer delay) {
   setDelay(delay);
   return sleepOnTrue(irRest.pressKey(keySet, command.toString()));
 }
Ejemplo n.º 12
0
 /**
  * This method does the pressKey for a particular command
  *
  * @see com.comcast.cats.provider.RemoteProvider#pressKey(com.comcast.cats.RemoteCommand)
  */
 @Override
 public boolean pressKey(RemoteCommand command) {
   return sleepOnTrue(irRest.pressKey(keySet, command.toString()));
 }