use of org.openhab.binding.tinkerforge.internal.types.DecimalValue in project openhab1-addons by openhab.
the class IndustrialDualAnalogInChannelImpl method setSensorValue.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setSensorValue(DecimalValue newSensorValue) {
DecimalValue oldSensorValue = sensorValue;
sensorValue = newSensorValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.INDUSTRIAL_DUAL_ANALOG_IN_CHANNEL__SENSOR_VALUE, oldSensorValue, sensorValue));
}
use of org.openhab.binding.tinkerforge.internal.types.DecimalValue in project openhab1-addons by openhab.
the class MBarometerTemperatureImpl method setSensorValue.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setSensorValue(DecimalValue newSensorValue) {
DecimalValue oldSensorValue = sensorValue;
sensorValue = newSensorValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.MBAROMETER_TEMPERATURE__SENSOR_VALUE, oldSensorValue, sensorValue));
}
use of org.openhab.binding.tinkerforge.internal.types.DecimalValue in project openhab1-addons by openhab.
the class MBrickDCImpl method handleVelocity.
/**
*
* @generated NOT
*/
private void handleVelocity(short velocity, boolean usethreshold) {
DecimalValue newValue = Tools.calculate(velocity);
logger.trace("{} got new value {}", LoggerConstants.TFMODELUPDATE, newValue);
if (usethreshold) {
if (newValue.compareTo(getSensorValue(), getThreshold()) != 0) {
logger.trace("{} setting new value {}", LoggerConstants.TFMODELUPDATE, newValue);
setSensorValue(newValue);
} else {
logger.trace("{} omitting new value {}", LoggerConstants.TFMODELUPDATE, newValue);
}
} else {
logger.trace("{} setting new value {}", LoggerConstants.TFMODELUPDATE, newValue);
setSensorValue(newValue);
}
OnOffValue newSwitchState = newValue.onOffValue(0);
logger.trace("new switchstate {} new value {}", newSwitchState, newValue);
if (newSwitchState != switchState) {
setSwitchState(newSwitchState);
}
}
use of org.openhab.binding.tinkerforge.internal.types.DecimalValue in project openhab1-addons by openhab.
the class JoystickXPositionImpl method setSensorValue.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setSensorValue(DecimalValue newSensorValue) {
DecimalValue oldSensorValue = sensorValue;
sensorValue = newSensorValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.JOYSTICK_XPOSITION__SENSOR_VALUE, oldSensorValue, sensorValue));
}
use of org.openhab.binding.tinkerforge.internal.types.DecimalValue in project openhab1-addons by openhab.
the class JoystickXPositionImpl method fetchSensorValue.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void fetchSensorValue() {
try {
Position position = tinkerforgeDevice.getPosition();
DecimalValue value = Tools.calculate(position.x);
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);
}
}
Aggregations