Search in sources :

Example 1 with RemoteSwitch

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

the class MBrickletRemoteSwitchImpl method addSubDevice.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void addSubDevice(String subId, String subDeviceType) {
    ModelFactory factory = ModelFactory.eINSTANCE;
    RemoteSwitch subDevice = null;
    if (subDeviceType.equals("A")) {
        logger.debug("{} addSubDevice A for subId {}", LoggerConstants.TFINITSUB, subId);
        subDevice = factory.createRemoteSwitchA();
    } else if (subDeviceType.equals("B")) {
        logger.debug("{} addSubDevice B for subId {}", LoggerConstants.TFINITSUB, subId);
        subDevice = factory.createRemoteSwitchB();
    } else if (subDeviceType.equals("C")) {
        logger.debug("{} addSubDevice C for subId {}", LoggerConstants.TFINITSUB, subId);
        subDevice = factory.createRemoteSwitchC();
    } else {
        logger.error("{} unknown sub device type {} for {}", LoggerConstants.TFINITSUB, subDeviceType, subId);
    }
    if (subDevice != null) {
        logger.debug("{} add sub device subId {} for uid {}", LoggerConstants.TFINITSUB, subId, getUid());
        subDevice.setUid(getUid());
        subDevice.setSubId(subId);
        subDevice.init();
        subDevice.setMbrick(this);
    }
}
Also used : ModelFactory(org.openhab.binding.tinkerforge.internal.model.ModelFactory) MBrickletRemoteSwitch(org.openhab.binding.tinkerforge.internal.model.MBrickletRemoteSwitch) BrickletRemoteSwitch(com.tinkerforge.BrickletRemoteSwitch) RemoteSwitch(org.openhab.binding.tinkerforge.internal.model.RemoteSwitch)

Aggregations

BrickletRemoteSwitch (com.tinkerforge.BrickletRemoteSwitch)1 MBrickletRemoteSwitch (org.openhab.binding.tinkerforge.internal.model.MBrickletRemoteSwitch)1 ModelFactory (org.openhab.binding.tinkerforge.internal.model.ModelFactory)1 RemoteSwitch (org.openhab.binding.tinkerforge.internal.model.RemoteSwitch)1