Search in sources :

Example 16 with EnoceanParameterAddress

use of org.opencean.core.address.EnoceanParameterAddress in project openhab1-addons by openhab.

the class RockerSwitchInDimmerProfileTest method increaseLightOnShortButtonPressUp.

@Test
public void increaseLightOnShortButtonPressUp() {
    EnoceanParameterAddress valueParameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), Parameter.O);
    binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
    waitFor(10);
    assertEquals("Update State", IncreaseDecreaseType.INCREASE, publisher.popLastCommand());
    binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
    waitFor(10);
    assertNull("Update State", publisher.popLastCommand());
}
Also used : EnoceanParameterAddress(org.opencean.core.address.EnoceanParameterAddress) Test(org.junit.Test)

Example 17 with EnoceanParameterAddress

use of org.opencean.core.address.EnoceanParameterAddress in project openhab1-addons by openhab.

the class RockerSwitchInDimmerProfileTest method lightenUpDuringVeryLongButtonPressUp.

@Test
public void lightenUpDuringVeryLongButtonPressUp() {
    EnoceanParameterAddress valueParameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), Parameter.O);
    binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
    waitFor(10);
    assertEquals("Update State", IncreaseDecreaseType.INCREASE, publisher.popLastCommand());
    waitFor(300);
    assertEquals("Update State", IncreaseDecreaseType.INCREASE, publisher.popLastCommand());
    waitFor(300);
    assertEquals("Update State", IncreaseDecreaseType.INCREASE, publisher.popLastCommand());
    binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
    waitFor(10);
    assertNull("Update State", publisher.popLastCommand());
}
Also used : EnoceanParameterAddress(org.opencean.core.address.EnoceanParameterAddress) Test(org.junit.Test)

Example 18 with EnoceanParameterAddress

use of org.opencean.core.address.EnoceanParameterAddress in project openhab1-addons by openhab.

the class RockerSwitchInDimmerSteppingProfileTest method setUpDefaultDevice.

@Before
public void setUpDefaultDevice() {
    parameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), CHANNEL);
    provider.setParameterAddress(parameterAddress);
    provider.setItem(new DimmerItem("dummie"));
    provider.setEep(EEPId.EEP_F6_02_01);
    binding.addBindingProvider(provider);
}
Also used : EnoceanParameterAddress(org.opencean.core.address.EnoceanParameterAddress) DimmerItem(org.openhab.core.library.items.DimmerItem) Before(org.junit.Before)

Example 19 with EnoceanParameterAddress

use of org.opencean.core.address.EnoceanParameterAddress in project openhab1-addons by openhab.

the class RockerSwitchInDimmerSteppingProfileTest method lightenUpDuringLongButtonPressDown.

@Test
public void lightenUpDuringLongButtonPressDown() {
    EnoceanParameterAddress valueParameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), CHANNEL, Parameter.I);
    binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
    waitFor(10);
    assertEquals("Update State", IncreaseDecreaseType.INCREASE, publisher.popLastCommand());
    waitFor(300);
    assertEquals("Update State", IncreaseDecreaseType.INCREASE, publisher.popLastCommand());
    binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
    waitFor(10);
    assertNull("Update State", publisher.popLastCommand());
}
Also used : EnoceanParameterAddress(org.opencean.core.address.EnoceanParameterAddress) Test(org.junit.Test)

Example 20 with EnoceanParameterAddress

use of org.opencean.core.address.EnoceanParameterAddress in project openhab1-addons by openhab.

the class RockerSwitchInDimmerOnOffProfileTest method doNothingOnWrongChannel.

@Test
public void doNothingOnWrongChannel() {
    EnoceanParameterAddress valueParameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), "A", Parameter.I);
    binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
    waitFor(10);
    assertNull("Update State", publisher.popLastCommand());
    binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
    waitFor(10);
    assertNull("Update State", publisher.popLastCommand());
}
Also used : EnoceanParameterAddress(org.opencean.core.address.EnoceanParameterAddress) Test(org.junit.Test)

Aggregations

EnoceanParameterAddress (org.opencean.core.address.EnoceanParameterAddress)39 Test (org.junit.Test)31 Before (org.junit.Before)6 DimmerItem (org.openhab.core.library.items.DimmerItem)5 SwitchItem (org.openhab.core.library.items.SwitchItem)4 RollershutterItem (org.openhab.core.library.items.RollershutterItem)3 StringItem (org.openhab.core.library.items.StringItem)3 Item (org.openhab.core.items.Item)2 DecimalType (org.openhab.core.library.types.DecimalType)2 NoSuchPortException (gnu.io.NoSuchPortException)1 BigDecimal (java.math.BigDecimal)1 EEPId (org.opencean.core.common.EEPId)1 NumberWithUnit (org.opencean.core.common.values.NumberWithUnit)1 DimmerOnOffProfile (org.openhab.binding.enocean.internal.profiles.DimmerOnOffProfile)1 Profile (org.openhab.binding.enocean.internal.profiles.Profile)1 RollershutterProfile (org.openhab.binding.enocean.internal.profiles.RollershutterProfile)1 StandardProfile (org.openhab.binding.enocean.internal.profiles.StandardProfile)1 SwitchOnOffProfile (org.openhab.binding.enocean.internal.profiles.SwitchOnOffProfile)1 WindowHandleProfile (org.openhab.binding.enocean.internal.profiles.WindowHandleProfile)1 EventPublisher (org.openhab.core.events.EventPublisher)1