use of org.opencean.core.address.EnoceanParameterAddress in project openhab1-addons by openhab.
the class WindowHandleTest method setUpDefaultDevice.
@Before
public void setUpDefaultDevice() {
parameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID));
provider.setParameterAddress(parameterAddress);
provider.setItem(new StringItem("dummie"));
provider.setEep(EEPId.EEP_F6_10_00);
binding.addBindingProvider(provider);
}
use of org.opencean.core.address.EnoceanParameterAddress in project openhab1-addons by openhab.
the class EnoceanGenericBindingProviderTest method testGetParameterAddress.
@Test
public void testGetParameterAddress() throws BindingConfigParseException {
EnoceanGenericBindingProvider provider = new EnoceanGenericBindingProvider();
provider.processBindingConfiguration("enocean", new TestItem("item"), "{id=00:8B:62:43, eep=F6:02:01, channel=B, parameter=I_PRESSED}");
assertEquals(new EnoceanParameterAddress(EnoceanId.fromString("00:8B:62:43"), "B", "I_PRESSED"), provider.getParameterAddress("item"));
}
use of org.opencean.core.address.EnoceanParameterAddress in project openhab1-addons by openhab.
the class EnoceanBinding method queryAndSendActualState.
private void queryAndSendActualState(EnoceanBindingProvider provider, String itemName) {
EnoceanParameterAddress parameterAddress = provider.getParameterAddress(itemName);
Item item = provider.getItem(itemName);
if (item == null) {
logger.warn("No item found for " + parameterAddress + " - doing nothing.");
return;
}
State value = getValueFromDevice(parameterAddress, item);
if (value != null) {
eventPublisher.postUpdate(itemName, value);
}
}
use of org.opencean.core.address.EnoceanParameterAddress in project openhab1-addons by openhab.
the class RockerSwitchInDimmerSteppingProfileTest method increaseLightBy30OnShortButtonPressDown.
@Test
public void increaseLightBy30OnShortButtonPressDown() {
EnoceanParameterAddress valueParameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), CHANNEL, Parameter.I);
binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
waitFor(10);
assertEquals("Update State", null, publisher.popLastCommand());
binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
waitFor(10);
assertEquals("Update State", new DecimalType(30), publisher.popLastCommand());
}
use of org.opencean.core.address.EnoceanParameterAddress in project openhab1-addons by openhab.
the class RockerSwitchInDimmerSteppingProfileTest method switchOffLightOnShortButtonPressUp.
@Test
public void switchOffLightOnShortButtonPressUp() {
EnoceanParameterAddress valueParameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), CHANNEL, Parameter.O);
binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
waitFor(10);
assertEquals("Update State", IncreaseDecreaseType.DECREASE, publisher.popLastCommand());
binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
waitFor(10);
assertEquals("Update State", OnOffType.OFF, publisher.popLastCommand());
}
Aggregations