use of org.openhab.binding.tinkerforge.internal.model.ModelFactory in project openhab1-addons by openhab.
the class MBrickletColorImpl method initSubDevices.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void initSubDevices() {
ModelFactory factory = ModelFactory.eINSTANCE;
ColorColor color = factory.createColorColor();
color.setUid(getUid());
String subIdColor = "color";
color.setSubId(subIdColor);
logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdColor);
color.init();
color.setMbrick(this);
ColorColorTemperature temperature = factory.createColorColorTemperature();
temperature.setUid(getUid());
String subIdTemperature = "temperature";
temperature.setSubId(subIdTemperature);
logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdTemperature);
temperature.init();
temperature.setMbrick(this);
ColorIlluminance illuminance = factory.createColorIlluminance();
illuminance.setUid(getUid());
String subIdIlluminance = "illuminance";
illuminance.setSubId(subIdIlluminance);
logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdIlluminance);
illuminance.init();
illuminance.setMbrick(this);
ColorLed led = factory.createColorLed();
led.setUid(getUid());
String subIdLed = "led";
led.setSubId(subIdLed);
logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdLed);
led.init();
led.setMbrick(this);
}
use of org.openhab.binding.tinkerforge.internal.model.ModelFactory in project openhab1-addons by openhab.
the class MBrickServoImpl method initSubDevices.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void initSubDevices() {
ModelFactory factory = ModelFactory.eINSTANCE;
for (int i = 0; i < 7; i++) {
MServo mServo = factory.createMServo();
mServo.setUid(uid);
String subId = "servo" + String.valueOf(i);
logger.debug("addSubDevice " + subId);
mServo.setSubId(subId);
mServo.init();
mServo.setMbrick(this);
getMsubdevices().add(mServo);
}
}
use of org.openhab.binding.tinkerforge.internal.model.ModelFactory in project openhab1-addons by openhab.
the class MBrickletAccelerometerImpl method initSubDevices.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void initSubDevices() {
ModelFactory factory = ModelFactory.eINSTANCE;
AccelerometerDirection x = factory.createAccelerometerDirection();
x.setDirection(AccelerometerCoordinate.X);
x.setUid(getUid());
String subIdX = "x";
logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdX);
x.setSubId(subIdX);
x.init();
x.setMbrick(this);
AccelerometerDirection y = factory.createAccelerometerDirection();
y.setDirection(AccelerometerCoordinate.Y);
y.setUid(getUid());
String subIdY = "y";
logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdY);
y.setSubId(subIdY);
y.init();
y.setMbrick(this);
AccelerometerDirection z = factory.createAccelerometerDirection();
z.setDirection(AccelerometerCoordinate.Z);
z.setUid(getUid());
String subIdZ = "z";
logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdZ);
z.setSubId(subIdZ);
z.init();
z.setMbrick(this);
AccelerometerTemperature temperature = factory.createAccelerometerTemperature();
temperature.setUid(getUid());
String subIdTemperature = "temperature";
logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdTemperature);
temperature.setSubId(subIdTemperature);
temperature.init();
temperature.setMbrick(this);
AccelerometerLed led = factory.createAccelerometerLed();
led.setUid(getUid());
String subIdLed = "led";
logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdLed);
led.setSubId(subIdLed);
led.init();
led.setMbrick(this);
}
use of org.openhab.binding.tinkerforge.internal.model.ModelFactory 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);
}
}
use of org.openhab.binding.tinkerforge.internal.model.ModelFactory in project openhab1-addons by openhab.
the class MBrickletMultiTouchImpl method initSubDevices.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void initSubDevices() {
ModelFactory factory = ModelFactory.eINSTANCE;
for (int i = 0; i < 12; i++) {
Electrode electrode = factory.createElectrode();
electrode.setUid(getUid());
String subId = "electrode" + i;
electrode.setSubId(subId);
electrode.setPin(i);
electrode.init();
electrode.setMbrick(this);
logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subId);
}
Proximity proximity = factory.createProximity();
proximity.setUid(getUid());
String subId = "proximity";
proximity.setSubId(subId);
proximity.setPin(12);
proximity.init();
proximity.setMbrick(this);
logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subId);
}
Aggregations