Search in sources :

Example 6 with EnoceanParameterAddress

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

the class RockerSwitchInRollershutterProfileTest method stopShutterMovingDownOnShortPressUp.

@Test
public void stopShutterMovingDownOnShortPressUp() {
    EnoceanParameterAddress valueParameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), Parameter.I);
    binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
    publisher.popLastCommand();
    binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
    assertEquals("No new state expected", null, publisher.popLastCommand());
    waitFor(100);
    valueParameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), Parameter.O);
    binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
    assertEquals("Update State", StopMoveType.STOP, publisher.popLastCommand());
    binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
    assertEquals("No new state expected", null, publisher.popLastCommand());
}
Also used : EnoceanParameterAddress(org.opencean.core.address.EnoceanParameterAddress) Test(org.junit.Test)

Example 7 with EnoceanParameterAddress

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

the class RockerSwitchInRollershutterProfileTest method openShutterOnShortButtonPressUp.

@Test
public void openShutterOnShortButtonPressUp() {
    EnoceanParameterAddress valueParameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), Parameter.O);
    binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
    assertEquals("Update State", UpDownType.UP, publisher.popLastCommand());
    binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
    assertEquals("No new state expected", null, publisher.popLastCommand());
}
Also used : EnoceanParameterAddress(org.opencean.core.address.EnoceanParameterAddress) Test(org.junit.Test)

Example 8 with EnoceanParameterAddress

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

the class RockerSwitchInRollershutterProfileTest method closeShutterOnShortButtonPressDown.

@Test
public void closeShutterOnShortButtonPressDown() {
    EnoceanParameterAddress valueParameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), Parameter.I);
    binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
    assertEquals("Update State", UpDownType.DOWN, publisher.popLastCommand());
    binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
    assertEquals("No new state expected", null, publisher.popLastCommand());
}
Also used : EnoceanParameterAddress(org.opencean.core.address.EnoceanParameterAddress) Test(org.junit.Test)

Example 9 with EnoceanParameterAddress

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

the class RockerSwitchInRollershutterProfileTest method stopShutterMovingAndStartAgain.

@Test
public void stopShutterMovingAndStartAgain() {
    EnoceanParameterAddress valueParameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), Parameter.O);
    binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
    binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
    assertEquals("Update State", UpDownType.UP, publisher.popLastCommand());
    waitFor(100);
    binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
    binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
    assertEquals("Update State", StopMoveType.STOP, publisher.popLastCommand());
    waitFor(100);
    binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
    binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
    assertEquals("Update State", UpDownType.UP, publisher.popLastCommand());
    waitFor(100);
    binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
    binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
    assertEquals("Update State", StopMoveType.STOP, publisher.popLastCommand());
    waitFor(100);
    binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
    binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
    assertEquals("Update State", UpDownType.UP, publisher.popLastCommand());
    assertEquals("No new state expected", null, publisher.popLastCommand());
}
Also used : EnoceanParameterAddress(org.opencean.core.address.EnoceanParameterAddress) Test(org.junit.Test)

Example 10 with EnoceanParameterAddress

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

the class RockerSwitchInSwitchOnOffProfileTest method setUpDefaultDevice.

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

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