Examples of NikobusCommand


Examples of org.openhab.binding.nikobus.internal.core.NikobusCommand

  }

  @Test
  public void canRequestGroup1Status() throws Exception {

    NikobusCommand cmd = group1.getStatusRequestCommand();
    assertEquals("$10126C946CE5A0", cmd.getCommand());
    assertEquals("$1C6C94", cmd.getAck());

  }
View Full Code Here

Examples of org.openhab.binding.nikobus.internal.core.NikobusCommand

  }

  @Test
  public void canRequestGroup2Status() throws Exception {

    NikobusCommand cmd = group2.getStatusRequestCommand();
    assertEquals("$10176C948715BB", cmd.getCommand());
    assertEquals("$1C6C94", cmd.getAck());
  }
View Full Code Here

Examples of org.openhab.binding.nikobus.internal.core.NikobusCommand

    group1.publishStateToNikobus(item, binding);

    Mockito.verify(binding, Mockito.times(1)).sendCommand(
        command.capture());

    NikobusCommand cmd = command.getAllValues().get(0);
    assertEquals("$1E156C94000000FF0000FF60E149", cmd.getCommand());
  }
View Full Code Here

Examples of org.openhab.binding.nikobus.internal.core.NikobusCommand

    group1.publishStateToNikobus(item, binding);

    Mockito.verify(binding, Mockito.times(1)).sendCommand(
        command.capture());

    NikobusCommand cmd = command.getAllValues().get(0);
    assertEquals("$1E156C94000000400000FF45DE7B", cmd.getCommand());
  }
View Full Code Here

Examples of org.openhab.binding.nikobus.internal.core.NikobusCommand

    group2.publishStateToNikobus(item2, binding);

    Mockito.verify(binding, Mockito.times(1)).sendCommand(
        command.capture());

    NikobusCommand cmd = command.getAllValues().get(0);
    assertEquals("$1E166C940000000000FFFF997295", cmd.getCommand());
  }
View Full Code Here

Examples of org.openhab.binding.nikobus.internal.core.NikobusCommand

  public void canProcessGroup1StatusUpdate() {

    ModuleChannel item = group1.addChannel("test5", 5, new ArrayList<Class<? extends Command>>());
    item.setState(OnOffType.OFF);

    group1.processNikobusCommand(new NikobusCommand("$0512"), binding);

    group1.processNikobusCommand(new NikobusCommand(
        "$1C6C940000000000FF00557CF8"), binding);
    Mockito.verify(binding, Mockito.times(1)).postUpdate("test5",
        OnOffType.ON);

    group1.processNikobusCommand(new NikobusCommand("$0512"), binding);
    group1.processNikobusCommand(new NikobusCommand(
        "$1C6C9400000000FF00FF557CF8"), binding);
    Mockito.verify(binding, Mockito.times(1)).postUpdate("test5",
        OnOffType.OFF);
  }
View Full Code Here

Examples of org.openhab.binding.nikobus.internal.core.NikobusCommand

  public void canProcessGroup2StatusUpdate() {

    ModuleChannel item = group2.addChannel("test11", 11, new ArrayList<Class<? extends Command>>());
    item.setState(OnOffType.OFF);

    group2.processNikobusCommand(new NikobusCommand("$0517"), binding);
    group2.processNikobusCommand(new NikobusCommand(
        "$1C6C940000000000FF00557CF8"), binding);
    Mockito.verify(binding, Mockito.times(1)).postUpdate("test11",
        OnOffType.ON);

    group2.processNikobusCommand(new NikobusCommand("$0517"), binding);
    group2.processNikobusCommand(new NikobusCommand(
        "$1C6C9400000000FF00FF557CF8"), binding);
    Mockito.verify(binding, Mockito.times(1)).postUpdate("test11",
        OnOffType.OFF);

  }
View Full Code Here

Examples of org.openhab.binding.nikobus.internal.core.NikobusCommand

    List<Class<? extends Command>> acceptedCommands = new ArrayList<Class<? extends Command>>();
    acceptedCommands.add(PercentType.class);
    ModuleChannel item = group3.addChannel("test2", 1, acceptedCommands);
    item.setState(OnOffType.OFF);

    group3.processNikobusCommand(new NikobusCommand("$0512"), binding);
    group3.processNikobusCommand(new NikobusCommand(
        "$1C5FCB03400000000000E36D38"), binding);
    Mockito.verify(binding, Mockito.times(1)).postUpdate("test2",
        PercentType.valueOf("26"));

    group3.processNikobusCommand(new NikobusCommand("$0512"), binding);
    group3.processNikobusCommand(new NikobusCommand(
        "$1C5FCB037F000000000009E2C0"), binding);
    Mockito.verify(binding, Mockito.times(1)).postUpdate("test2",
        PercentType.valueOf("50"));
   
    group3.processNikobusCommand(new NikobusCommand("$0512"), binding);
    group3.processNikobusCommand(new NikobusCommand(
        "$1C5FCB03D90000000000652B76"), binding);
    Mockito.verify(binding, Mockito.times(1)).postUpdate("test2",
        PercentType.valueOf("86"));
   
    group3.processNikobusCommand(new NikobusCommand("$0512"), binding);
    group3.processNikobusCommand(new NikobusCommand(
        "$1C5FCB03A70000000000A0143B"), binding);
    Mockito.verify(binding, Mockito.times(1)).postUpdate("test2",
        PercentType.valueOf("66"));
   
  }
View Full Code Here

Examples of org.openhab.binding.nikobus.internal.core.NikobusCommand

      }

      if (cmd.equals("send")) {
        String data = intp.nextArgument();
        if (data != null && data.length() > 0) {
          binding.sendCommand(new NikobusCommand(data));
        } else {
          intp.println("Missing command argument. Enclose command in single quotes. E.g. nikobus send '#N0D4CE6'");
          intp.print(getHelp());
        }
        return null;
View Full Code Here

Examples of org.openhab.binding.nikobus.internal.core.NikobusCommand

   *            when true, sending will wait for empty bus
   */
  public void scheduleStatusUpdateRequest(String moduleAddress, boolean delayedSend) {

    NikobusModule module = getBindingProvider().getModule(moduleAddress);
    final NikobusCommand cmd = module.getStatusRequestCommand();
    cmd.setWaitForSilence(delayedSend);
    cmd.setMaxRetryCount(10);

    if (commandSender.isCommandRedundant(cmd)) {
      // no need to send, there is a similar command already pending
      return;
    }
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.