Examples of EnoceanParameterAddress


Examples of org.opencean.core.address.EnoceanParameterAddress

    }

    @Override
    public EnoceanParameterAddress getParameterAddress(String itemName) {
        EnoceanBindingConfig config = (EnoceanBindingConfig) bindingConfigs.get(itemName);
        return config != null ? new EnoceanParameterAddress(EnoceanId.fromString(config.id), config.channel, config.parameter) : null;
    }
View Full Code Here

Examples of org.opencean.core.address.EnoceanParameterAddress

            }
        }
    }

    private void processEEPs(EnoceanBindingProvider enoceanBindingProvider, String itemName) {
        EnoceanParameterAddress parameterAddress = enoceanBindingProvider.getParameterAddress(itemName);
        EEPId eep = enoceanBindingProvider.getEEP(itemName);
        esp3Host.addDeviceProfile(parameterAddress.getEnoceanDeviceId(), eep);
        Item item = enoceanBindingProvider.getItem(itemName);
        if (profiles.containsKey(parameterAddress.getAsString())) {
            Profile profile = profiles.get(parameterAddress.getAsString());
            profile.removeItem(item);
        }
        Class<Profile> customProfileClass = enoceanBindingProvider.getCustomProfile(itemName);
        if (customProfileClass != null) {
            Constructor<Profile> constructor;
            Profile profile;
            try {
                constructor = customProfileClass.getConstructor(Item.class, EventPublisher.class);
                profile = constructor.newInstance(item, eventPublisher);
                addProfile(item, parameterAddress, profile);
            } catch (Exception e) {
                logger.error("Could not create class for profile " + customProfileClass, e);
            }
        } else if (EEPId.EEP_F6_02_01.equals(eep) || EEPId.EEP_F6_10_00.equals(eep)) {
            if (item.getClass().equals(RollershutterItem.class)) {
                RollershutterProfile profile = new RollershutterProfile(item, eventPublisher);
                addProfile(item, parameterAddress, profile);
            }
            if (item.getClass().equals(DimmerItem.class)) {
                DimmerOnOffProfile profile = new DimmerOnOffProfile(item, eventPublisher);
                addProfile(item, parameterAddress, profile);
            }
            if (item.getClass().equals(SwitchItem.class) && parameterAddress.getParameterId() == null) {
                SwitchOnOffProfile profile = new SwitchOnOffProfile(item, eventPublisher);
                addProfile(item, parameterAddress, profile);
            }
            if (item.getClass().equals(StringItem.class) && EEPId.EEP_F6_10_00.equals(eep)) {
                WindowHandleProfile profile = new WindowHandleProfile(item, eventPublisher);
View Full Code Here

Examples of org.opencean.core.address.EnoceanParameterAddress

            profiles.put(parameterAddress.getAsString(), profile);
        }
    }

    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;
        }
View Full Code Here

Examples of org.opencean.core.address.EnoceanParameterAddress

    @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"));
    }
View Full Code Here

Examples of org.opencean.core.address.EnoceanParameterAddress

    private static final String CHANNEL = "B";

    @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);
    }
View Full Code Here

Examples of org.opencean.core.address.EnoceanParameterAddress

        binding.addBindingProvider(provider);
    }

    @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());
    }
View Full Code Here

Examples of org.opencean.core.address.EnoceanParameterAddress

        assertEquals("Update State", OnOffType.ON, publisher.popLastCommand());
    }

    @Test
    public void switchOffForButtonPressDown() {
        EnoceanParameterAddress valueParameterAddress = new EnoceanParameterAddress(
                EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), CHANNEL, Parameter.O);
        binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
        assertEquals("Update State", OnOffType.OFF, publisher.popLastCommand());
    }
View Full Code Here

Examples of org.opencean.core.address.EnoceanParameterAddress

@Ignore
public class RockerSwitchInDimmerProfileTest extends BasicBindingTest {

    @Before
    public void setUpDefaultDevice() {
        parameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID));
        provider.setParameterAddress(parameterAddress);
        provider.setItem(new DimmerItem("dummie"));
        provider.setEep(EEPId.EEP_F6_02_01);
        binding.addBindingProvider(provider);
    }
View Full Code Here

Examples of org.opencean.core.address.EnoceanParameterAddress

        binding.addBindingProvider(provider);
    }

    @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);
View Full Code Here

Examples of org.opencean.core.address.EnoceanParameterAddress

        assertNull("Update State", publisher.popLastCommand());
    }

    @Test
    public void decreaseLightOnShortButtonPressDown() {
        EnoceanParameterAddress valueParameterAddress = new EnoceanParameterAddress(
                EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), Parameter.I);
        binding.valueChanged(valueParameterAddress, ButtonState.PRESSED);
        waitFor(10);
        assertEquals("Update State", IncreaseDecreaseType.DECREASE, publisher.popLastCommand());
        binding.valueChanged(valueParameterAddress, ButtonState.RELEASED);
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.