Examples of DmxService


Examples of org.openhab.binding.dmx.DmxService

  @Test
  public void canBeSetWithHsbCommand() throws BindingConfigParseException {

    DmxItem item = getValidInstance();
    DmxService service = Mockito.mock(DmxService.class);

    HSBType hsb = new HSBType(DecimalType.ZERO, PercentType.HUNDRED,
        PercentType.HUNDRED);
    item.processCommand(service, hsb);
View Full Code Here

Examples of org.openhab.binding.dmx.DmxService

  @Override
  public void decreasesWhenDecreaseCommandReceived()
      throws BindingConfigParseException {

    DmxItem item = getValidInstance();
    DmxService service = Mockito.mock(DmxService.class);

    HSBType hsb = new HSBType(new DecimalType(150), new PercentType(50),
        new PercentType(50));
    item.processCommand(service, hsb);
View Full Code Here

Examples of org.openhab.binding.dmx.DmxService

  @Override
  public void increasesWhenIncreaseCommandReceived()
      throws BindingConfigParseException {

    DmxItem item = getValidInstance();
    DmxService service = Mockito.mock(DmxService.class);

    HSBType hsb = new HSBType(new DecimalType(150), new PercentType(50),
        new PercentType(50));
    item.processCommand(service, hsb);
View Full Code Here

Examples of org.openhab.binding.dmx.DmxService

  @Test
  public void canBeSetWith0PercentType() throws BindingConfigParseException {

    DmxItem item = getValidInstance();
    DmxService service = Mockito.mock(DmxService.class);
    item.processCommand(service, new PercentType(0));
    Mockito.verify(service).setChannelValue(3, 0);
    Mockito.verify(service).setChannelValue(4, 0);
    Mockito.verify(service).setChannelValue(5, 0);
  }
View Full Code Here

Examples of org.openhab.binding.dmx.DmxService

  @Test
  public void canBeSetWithPercentType() throws BindingConfigParseException {

    DmxItem item = getValidInstance();
    DmxService service = Mockito.mock(DmxService.class);
    item.processCommand(service, new PercentType(50));
    Mockito.verify(service).setChannelValue(3, 129);
    Mockito.verify(service).setChannelValue(4, 129);
    Mockito.verify(service).setChannelValue(5, 129);
  }
View Full Code Here

Examples of org.openhab.binding.dmx.DmxService

 
  @Test
  public void decreasesWhenDecreaseCommandReceived() throws BindingConfigParseException {

    DmxItem item = getValidInstance();
    DmxService service = Mockito.mock(DmxService.class);

    Mockito.when(service.getChannelValue(3)).thenReturn(95);
    Mockito.when(service.getChannelValue(4)).thenReturn(3);

    item.processCommand(service, IncreaseDecreaseType.DECREASE);

    Mockito.verify(service).decreaseChannel(3, DmxDimmerItem.DIMMER_STEP_SIZE);
    Mockito.verify(service).decreaseChannel(4, DmxDimmerItem.DIMMER_STEP_SIZE);
View Full Code Here

Examples of org.openhab.binding.dmx.DmxService

 
  @Test
  public void increasesWhenIncreaseCommandReceived() throws BindingConfigParseException {

    DmxItem item = getValidInstance();
    DmxService service = Mockito.mock(DmxService.class);

    Mockito.when(service.getChannelValue(3)).thenReturn(95);
    Mockito.when(service.getChannelValue(4)).thenReturn(3);

    item.processCommand(service, IncreaseDecreaseType.INCREASE);

    Mockito.verify(service).enableChannel(3);
    Mockito.verify(service).increaseChannel(3, DmxDimmerItem.DIMMER_STEP_SIZE);
View Full Code Here

Examples of org.openhab.binding.dmx.DmxService

     
  @Test
  public void canBeSetWithPercentType() throws BindingConfigParseException {

    DmxItem item = getValidInstance();
    DmxService service = Mockito.mock(DmxService.class);

    Mockito.when(service.getChannelValue(3)).thenReturn(0);
    Mockito.when(service.getChannelValue(4)).thenReturn(155);

    item.processCommand(service, new PercentType(0));
    Mockito.verify(service).setChannelValue(3, DmxChannel.DMX_MAX_VALUE);
    Mockito.verify(service).setChannelValue(3, PercentType.ZERO);
    Mockito.verify(service).setChannelValue(4, DmxChannel.DMX_MAX_VALUE);
View Full Code Here

Examples of org.openhab.binding.dmx.DmxService

 
  @Test
  public void switchesOffWhenOffCommandReceived() throws BindingConfigParseException {

    DmxItem item = getValidInstance();
    DmxService service = Mockito.mock(DmxService.class);
   
    item.processCommand(service, OnOffType.OFF);
   
    Mockito.verify(service).disableChannel(3);
    Mockito.verify(service).disableChannel(4);
View Full Code Here

Examples of org.openhab.binding.dmx.DmxService

  @Test
  public void switchesOnWhenOnCommandReceived() throws BindingConfigParseException {
   
    DmxItem item = getValidInstance();
    DmxService service = Mockito.mock(DmxService.class);
   
    item.processCommand(service, OnOffType.ON);
   
    Mockito.verify(service).enableChannel(3);
    Mockito.verify(service).enableChannel(4);
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.