use of com.tinkerforge.BrickletIndustrialDigitalIn4 in project openhab1-addons by openhab.
the class MBrickletIndustrialDigitalIn4Impl method enable.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void enable() {
logger.debug("{} enable called on MBrickletIndustrialDigitalIn4", LoggerConstants.TFINIT);
tinkerforgeDevice = new BrickletIndustrialDigitalIn4(getUid(), getIpConnection());
if (tfConfig != null) {
if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature("debouncePeriod"))) {
setDebouncePeriod(tfConfig.getDebouncePeriod());
}
}
try {
tinkerforgeDevice.setResponseExpectedAll(true);
logger.debug("{} BrickletIndustrialDigital4In setting debouncePeriod to {}", LoggerConstants.TFINIT, getDebouncePeriod());
tinkerforgeDevice.setDebouncePeriod(getDebouncePeriod());
tinkerforgeDevice.setInterrupt(15);
} catch (TimeoutException e) {
TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);
} catch (NotConnectedException e) {
TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);
}
}
use of com.tinkerforge.BrickletIndustrialDigitalIn4 in project openhab1-addons by openhab.
the class MIndustrialDigitalInImpl method enable.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void enable() {
setSensorValue(HighLowValue.UNDEF);
MBrickletIndustrialDigitalIn4 bricklet = getMbrick();
if (bricklet == null) {
logger.error("{} No brick found for Digital4In: {} ", LoggerConstants.TFINIT, subId);
} else {
BrickletIndustrialDigitalIn4 brickletIndustrialDigitalIn4 = bricklet.getTinkerforgeDevice();
interruptListener = new InterruptListener();
brickletIndustrialDigitalIn4.addInterruptListener(interruptListener);
fetchSensorValue();
}
}
use of com.tinkerforge.BrickletIndustrialDigitalIn4 in project openhab1-addons by openhab.
the class MBrickletIndustrialDigitalIn4Impl method setTinkerforgeDevice.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setTinkerforgeDevice(BrickletIndustrialDigitalIn4 newTinkerforgeDevice) {
BrickletIndustrialDigitalIn4 oldTinkerforgeDevice = tinkerforgeDevice;
tinkerforgeDevice = newTinkerforgeDevice;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.MBRICKLET_INDUSTRIAL_DIGITAL_IN4__TINKERFORGE_DEVICE, oldTinkerforgeDevice, tinkerforgeDevice));
}
Aggregations