use of org.opencean.core.address.EnoceanParameterAddress in project openhab1-addons by openhab.
the class RockerSwitchInSwitchOnOffProfileTest method switchOnForButtonPressDown.
@Test
public void switchOnForButtonPressDown() {
EnoceanParameterAddress valueParameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), CHANNEL, Parameter.I);
binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
assertEquals("Update State", OnOffType.ON, publisher.popLastCommand());
}
use of org.opencean.core.address.EnoceanParameterAddress in project openhab1-addons by openhab.
the class RockerSwitchTest method testReceiveButtonPress.
@Test
public void testReceiveButtonPress() {
parameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), Parameter.I);
provider.setParameterAddress(parameterAddress);
binding.addBindingProvider(provider);
provider.setItem(new SwitchItem("dummie"));
binding.valueChanged(parameterAddress, ButtonState.PRESSED);
assertEquals("Update State", OnOffType.ON, publisher.getUpdateState());
}
use of org.opencean.core.address.EnoceanParameterAddress in project openhab1-addons by openhab.
the class TemperatureSensorTest method testReceiveTempertureUpdate.
@Test
public void testReceiveTempertureUpdate() {
parameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), Parameter.TEMPERATURE);
provider.setParameterAddress(parameterAddress);
binding.addBindingProvider(provider);
provider.setItem(new NumberItem("dummie"));
BigDecimal temperature = new BigDecimal("20.3");
binding.valueChanged(parameterAddress, new NumberWithUnit(Unit.DEGREE_CELSIUS, temperature));
assertEquals("Update State", new DecimalType(temperature), publisher.getUpdateState());
}
use of org.opencean.core.address.EnoceanParameterAddress in project openhab1-addons by openhab.
the class RockerSwitchInDimmerOnOffProfileTest method setUpDefaultDevice.
@Before
public void setUpDefaultDevice() {
parameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), CHANNEL, (String) null);
provider.setParameterAddress(parameterAddress);
provider.setItem(new DimmerItem("dummie"));
provider.setEep(EEPId.EEP_F6_02_01);
binding.addBindingProvider(provider);
}
use of org.opencean.core.address.EnoceanParameterAddress in project openhab1-addons by openhab.
the class RockerSwitchInDimmerOnOffProfileTest method lightenUpDuringVeryLongButtonPressDown.
@Test
public void lightenUpDuringVeryLongButtonPressDown() {
EnoceanParameterAddress valueParameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), CHANNEL, Parameter.I);
binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
waitFor(400);
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());
}
Aggregations