use of com.tinkerforge.NotConnectedException in project openhab1-addons by openhab.
the class MBrickletTemperatureImpl method fetchSensorValue.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void fetchSensorValue() {
try {
short temperature = tinkerforgeDevice.getTemperature();
DecimalValue value = Tools.calculate100(temperature);
setSensorValue(value);
} 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.NotConnectedException in project openhab1-addons by openhab.
the class VCDeviceCurrentImpl method fetchSensorValue.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void fetchSensorValue() {
try {
int current = tinkerforgeDevice.getCurrent();
DecimalValue value = Tools.calculate(current);
setSensorValue(value);
} 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.NotConnectedException in project openhab1-addons by openhab.
the class VCDevicePowerImpl method fetchSensorValue.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void fetchSensorValue() {
try {
int power = tinkerforgeDevice.getPower();
DecimalValue value = Tools.calculate(power);
setSensorValue(value);
} 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.NotConnectedException 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.NotConnectedException in project openhab1-addons by openhab.
the class ColorColorImpl method fetchSensorValue.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void fetchSensorValue() {
try {
com.tinkerforge.BrickletColor.Color color = tinkerforgeDevice.getColor();
setSensorValue(new HSBValue(new HSBType(new Color(getRGBValue(color.r), getRGBValue(color.g), getRGBValue(color.b)))));
} catch (TimeoutException e) {
TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);
} catch (NotConnectedException e) {
TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);
}
}
Aggregations