Search in sources :

Example 1 with MBrickletRemoteSwitch

use of org.openhab.binding.tinkerforge.internal.model.MBrickletRemoteSwitch in project openhab1-addons by openhab.

the class MBrickletRemoteSwitchImpl method enable.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void enable() {
    logger.debug("enable called on MBrickletRemoteSwitch");
    tinkerforgeDevice = new BrickletRemoteSwitch(getUid(), getIpConnection());
    tinkerforgeDevice.setResponseExpectedAll(true);
    tinkerforgeDevice = new BrickletRemoteSwitch(getUid(), getIpConnection());
    if (tfConfig != null) {
        if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature(ModelPackage.BRICKLET_REMOTE_SWITCH_CONFIGURATION__TYPE_ADEVICES))) {
            String[] type_a_sub_devices = tfConfig.getTypeADevices().trim().split("\\s+");
            List<String> subIdList = new ArrayList<String>(Arrays.asList(type_a_sub_devices));
            for (String subId : subIdList) {
                addSubDevice(subId, "A");
            }
        }
        if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature(ModelPackage.BRICKLET_REMOTE_SWITCH_CONFIGURATION__TYPE_BDEVICES))) {
            String[] type_b_sub_devices = tfConfig.getTypeBDevices().trim().split("\\s+");
            List<String> subIdList = new ArrayList<String>(Arrays.asList(type_b_sub_devices));
            for (String subId : subIdList) {
                addSubDevice(subId, "B");
            }
        }
        if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature(ModelPackage.BRICKLET_REMOTE_SWITCH_CONFIGURATION__TYPE_CDEVICES))) {
            String[] type_c_sub_devices = tfConfig.getTypeCDevices().trim().split("\\s+");
            List<String> subIdList = new ArrayList<String>(Arrays.asList(type_c_sub_devices));
            for (String subId : subIdList) {
                addSubDevice(subId, "C");
            }
        }
    }
}
Also used : ArrayList(java.util.ArrayList) MBrickletRemoteSwitch(org.openhab.binding.tinkerforge.internal.model.MBrickletRemoteSwitch) BrickletRemoteSwitch(com.tinkerforge.BrickletRemoteSwitch)

Aggregations

BrickletRemoteSwitch (com.tinkerforge.BrickletRemoteSwitch)1 ArrayList (java.util.ArrayList)1 MBrickletRemoteSwitch (org.openhab.binding.tinkerforge.internal.model.MBrickletRemoteSwitch)1