Search in sources :

Example 1 with DigitalSensorIO4

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

the class MBrickletIO4Impl method initSubDevices.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void initSubDevices() {
    ModelFactory factory = ModelFactory.eINSTANCE;
    for (int i = 0; i < 4; i++) {
        DigitalSensorIO4 sensor = factory.createDigitalSensorIO4();
        sensor.setUid(getUid());
        String genericDeviceId = String.valueOf(i);
        String subId = "in" + genericDeviceId;
        sensor.setSubId(subId);
        sensor.setPin(i);
        sensor.setGenericDeviceId(genericDeviceId);
        sensor.init();
        sensor.setMbrick(this);
        logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subId);
    }
    for (int i = 0; i < 4; i++) {
        DigitalActorIO4 actor = factory.createDigitalActorIO4();
        actor.setUid(getUid());
        String genericDeviceId = String.valueOf(i);
        String subId = "out" + genericDeviceId;
        actor.setSubId(subId);
        actor.setPin(i);
        actor.setGenericDeviceId(genericDeviceId);
        actor.init();
        actor.setMbrick(this);
        logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subId);
    }
}
Also used : DigitalSensorIO4(org.openhab.binding.tinkerforge.internal.model.DigitalSensorIO4) DigitalActorIO4(org.openhab.binding.tinkerforge.internal.model.DigitalActorIO4) ModelFactory(org.openhab.binding.tinkerforge.internal.model.ModelFactory)

Aggregations

DigitalActorIO4 (org.openhab.binding.tinkerforge.internal.model.DigitalActorIO4)1 DigitalSensorIO4 (org.openhab.binding.tinkerforge.internal.model.DigitalSensorIO4)1 ModelFactory (org.openhab.binding.tinkerforge.internal.model.ModelFactory)1