use of com.tinkerforge.BrickletLinearPoti in project openhab1-addons by openhab.
the class MBrickletLinearPotiImpl method setTinkerforgeDevice.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setTinkerforgeDevice(BrickletLinearPoti newTinkerforgeDevice) {
BrickletLinearPoti oldTinkerforgeDevice = tinkerforgeDevice;
tinkerforgeDevice = newTinkerforgeDevice;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.MBRICKLET_LINEAR_POTI__TINKERFORGE_DEVICE, oldTinkerforgeDevice, tinkerforgeDevice));
}
use of com.tinkerforge.BrickletLinearPoti in project openhab1-addons by openhab.
the class MBrickletLinearPotiImpl method enable.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void enable() {
setCallbackPeriod(10);
if (tfConfig != null) {
logger.trace("got configuration");
if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature("callbackPeriod"))) {
logger.trace("found callbackPeriod");
setCallbackPeriod(tfConfig.getCallbackPeriod());
}
}
logger.trace("callbackPeriod is {}", getCallbackPeriod());
tinkerforgeDevice = new BrickletLinearPoti(getUid(), getIpConnection());
listener = new PositionListener();
tinkerforgeDevice.addPositionListener(listener);
fetchSensorValue();
try {
tinkerforgeDevice.setPositionCallbackPeriod(getCallbackPeriod());
} catch (TimeoutException e) {
TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);
} catch (NotConnectedException e) {
TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);
}
}
Aggregations