use of org.openhab.binding.tinkerforge.internal.model.MBrickletIndustrialDigitalIn4 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 org.openhab.binding.tinkerforge.internal.model.MBrickletIndustrialDigitalIn4 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();
}
}
Aggregations