use of com.tinkerforge.BrickletTemperatureIR in project openhab1-addons by openhab.
the class ObjectTemperatureImpl 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());
}
if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature("emissivity"))) {
setEmissivity(tfConfig.getEmissivity());
}
}
thresholdBigDecimal = new BigDecimal(String.valueOf(getThreshold()));
BrickletTemperatureIR tinkerforgeDevice = getMbrick().getTinkerforgeDevice();
tinkerforgeDevice.setResponseExpected(BrickletTemperatureIR.FUNCTION_SET_OBJECT_TEMPERATURE_CALLBACK_PERIOD, false);
try {
tinkerforgeDevice.setObjectTemperatureCallbackPeriod(getCallbackPeriod());
tinkerforgeDevice.setEmissivity(getEmissivity());
temperatureListener = new ObjectTemperatureListener();
tinkerforgeDevice.addObjectTemperatureListener(temperatureListener);
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.BrickletTemperatureIR in project openhab1-addons by openhab.
the class AmbientTemperatureImpl 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());
}
}
thresholdBigDecimal = new BigDecimal(String.valueOf(getThreshold()));
BrickletTemperatureIR tinkerforgeDevice = getMbrick().getTinkerforgeDevice();
tinkerforgeDevice.setResponseExpected(BrickletTemperatureIR.FUNCTION_SET_AMBIENT_TEMPERATURE_CALLBACK_PERIOD, false);
try {
tinkerforgeDevice.setAmbientTemperatureCallbackPeriod(getCallbackPeriod());
} catch (TimeoutException e) {
TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);
} catch (NotConnectedException e) {
TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);
}
temperatureListener = new AmbientTemperatureListener();
tinkerforgeDevice.addAmbientTemperatureListener(temperatureListener);
fetchSensorValue();
}
use of com.tinkerforge.BrickletTemperatureIR in project openhab1-addons by openhab.
the class MBrickletTemperatureIRImpl method setTinkerforgeDevice.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setTinkerforgeDevice(BrickletTemperatureIR newTinkerforgeDevice) {
BrickletTemperatureIR oldTinkerforgeDevice = tinkerforgeDevice;
tinkerforgeDevice = newTinkerforgeDevice;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.MBRICKLET_TEMPERATURE_IR__TINKERFORGE_DEVICE, oldTinkerforgeDevice, tinkerforgeDevice));
}
Aggregations