Search in sources :

Example 1 with BrickletRemoteSwitch

use of com.tinkerforge.BrickletRemoteSwitch in project openhab1-addons by openhab.

the class MBrickletRemoteSwitchImpl method setTinkerforgeDevice.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated
     */
@Override
public void setTinkerforgeDevice(BrickletRemoteSwitch newTinkerforgeDevice) {
    BrickletRemoteSwitch oldTinkerforgeDevice = tinkerforgeDevice;
    tinkerforgeDevice = newTinkerforgeDevice;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.MBRICKLET_REMOTE_SWITCH__TINKERFORGE_DEVICE, oldTinkerforgeDevice, tinkerforgeDevice));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) MBrickletRemoteSwitch(org.openhab.binding.tinkerforge.internal.model.MBrickletRemoteSwitch) BrickletRemoteSwitch(com.tinkerforge.BrickletRemoteSwitch)

Example 2 with BrickletRemoteSwitch

use of com.tinkerforge.BrickletRemoteSwitch 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)2 MBrickletRemoteSwitch (org.openhab.binding.tinkerforge.internal.model.MBrickletRemoteSwitch)2 ArrayList (java.util.ArrayList)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1