Examples of LgTvCommand


Examples of org.openhab.binding.lgtv.lginteraction.LgTvCommand

    connection.checkpairing();

    {

      try {
        LgTvCommand lgcmd = LgTvCommand.valueOf(cmd);

        logger.debug("send to tv ip=" + ip + " command=" + cmd + " type=" + lgcmd.getCommandType() + " val="
            + val + " lgsendparam=" + lgcmd.getLgSendCommand());
        switch (lgcmd.getCommandType()) {
        case 0:
          result = connection.handlekeyinput(lgcmd.getLgSendCommand());
          break;
        case 1:
          result = connection.requestpairkey();
          break;
        case 2:
          connection.setpairkey(val);
          result = connection.sendpairkey();
          break;
        case 3:
          result = connection.handlechannelchangeeasy(val);
          break;
        case 4: {

          String answer = connection.getvolumeinfo(0);
          String ismuted = quickfind(answer, "mute");
          if (ismuted == "true")
            ismuted = "1";
          else
            ismuted = "0";

          String level = quickfind(answer, "level");
          logger.debug("getvolume answer=" + answer + " ismuted=" + ismuted + " level=" + level);

          String setter = "#nothing";
          setter = (lgcmd.getLgSendCommand() == "LEVEL") ? level : setter;
          setter = (lgcmd.getLgSendCommand() == "ISMUTED") ? ismuted : setter;
          result = setter;

        }
          ;
          break;

        case 5: {
          String answer = connection.getcurrentchannel();
          String displaymajor = quickfind(answer, "displayMajor");
          String chname = quickfind(answer, "chname");
          String progname = quickfind(answer, "progName");
          logger.debug("getcurrentchannel answer=" + answer + " displayMajor=" + displaymajor + " chname="
              + chname + " progname=" + progname);

          String setter = "#nothing";
          setter = (lgcmd.getLgSendCommand() == "NUMBER") ? displaymajor : setter;
          setter = (lgcmd.getLgSendCommand() == "PROG") ? progname : setter;
          setter = (lgcmd.getLgSendCommand() == "NAME") ? chname : setter;
          result = setter;
        }
          ;
          break;
View Full Code Here

Examples of org.openhab.binding.lgtv.lginteraction.LgTvCommand

        } else {

          // normal command

          LgTvCommand cmd = LgTvCommand.valueOf(deviceCmd);
          deviceCmd = cmd.getCommand();

          if (deviceCmd.contains("%")) {

            // eISCP command is a template where value should be
            // updated
View Full Code Here

Examples of org.openhab.binding.lgtv.lginteraction.LgTvCommand

        if (device != null && remoteController != null) {
          if (deviceCmd.startsWith(ADVANCED_COMMAND_KEY)) {
            deviceCmd = deviceCmd.replace(ADVANCED_COMMAND_KEY, "");
          } else {
            LgTvCommand cmd = LgTvCommand.valueOf(deviceCmd);
            deviceCmd = cmd.getCommand();
          }

          String result = "";
          if (remoteController != null) {
            result = remoteController.send(deviceCmd, "");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.