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));
}
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");
}
}
}
}
Aggregations