use of com.tinkerforge.BrickletBarometer in project openhab1-addons by openhab.
the class MBrickletBarometerImpl method enable.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void enable() {
if (tfConfig != null) {
if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature("threshold"))) {
setThreshold(tfConfig.getThreshold());
}
if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature("callbackPeriod"))) {
setCallbackPeriod(tfConfig.getCallbackPeriod());
}
}
tinkerforgeDevice = new BrickletBarometer(uid, ipConnection);
try {
tinkerforgeDevice.setResponseExpected(BrickletBarometer.FUNCTION_SET_AIR_PRESSURE_CALLBACK_PERIOD, false);
tinkerforgeDevice.setAirPressureCallbackPeriod(callbackPeriod);
listener = new AirPressureListener();
tinkerforgeDevice.addAirPressureListener(listener);
fetchSensorValue();
} 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.BrickletBarometer in project openhab1-addons by openhab.
the class MBrickletBarometerImpl method setTinkerforgeDevice.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setTinkerforgeDevice(BrickletBarometer newTinkerforgeDevice) {
BrickletBarometer oldTinkerforgeDevice = tinkerforgeDevice;
tinkerforgeDevice = newTinkerforgeDevice;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.MBRICKLET_BAROMETER__TINKERFORGE_DEVICE, oldTinkerforgeDevice, tinkerforgeDevice));
}
Aggregations