Search in sources :

Example 76 with DecimalValue

use of org.openhab.binding.tinkerforge.internal.types.DecimalValue in project openhab1-addons by openhab.

the class MBrickletAnalogInImpl method fetchSensorValue.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void fetchSensorValue() {
    try {
        int voltage = tinkerforgeDevice.getVoltage();
        DecimalValue value = Tools.calculate(voltage);
        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);
    }
}
Also used : DecimalValue(org.openhab.binding.tinkerforge.internal.types.DecimalValue) NotConnectedException(com.tinkerforge.NotConnectedException) TimeoutException(com.tinkerforge.TimeoutException)

Example 77 with DecimalValue

use of org.openhab.binding.tinkerforge.internal.types.DecimalValue in project openhab1-addons by openhab.

the class MBrickletAnalogInV2Impl method fetchSensorValue.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void fetchSensorValue() {
    try {
        int voltage = tinkerforgeDevice.getVoltage();
        DecimalValue value = Tools.calculate(voltage);
        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);
    }
}
Also used : DecimalValue(org.openhab.binding.tinkerforge.internal.types.DecimalValue) NotConnectedException(com.tinkerforge.NotConnectedException) TimeoutException(com.tinkerforge.TimeoutException)

Example 78 with DecimalValue

use of org.openhab.binding.tinkerforge.internal.types.DecimalValue in project openhab1-addons by openhab.

the class MBrickletAnalogInV2Impl 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.MBRICKLET_ANALOG_IN_V2__SENSOR_VALUE, oldSensorValue, sensorValue));
}
Also used : DecimalValue(org.openhab.binding.tinkerforge.internal.types.DecimalValue) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 79 with DecimalValue

use of org.openhab.binding.tinkerforge.internal.types.DecimalValue in project openhab1-addons by openhab.

the class MBrickletCO2Impl 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.MBRICKLET_CO2__SENSOR_VALUE, oldSensorValue, sensorValue));
}
Also used : DecimalValue(org.openhab.binding.tinkerforge.internal.types.DecimalValue) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 80 with DecimalValue

use of org.openhab.binding.tinkerforge.internal.types.DecimalValue in project openhab1-addons by openhab.

the class MBrickletLinearPotiImpl method fetchSensorValue.

/**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void fetchSensorValue() {
    try {
        int position = tinkerforgeDevice.getPosition();
        DecimalValue value = Tools.calculate(position);
        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);
    }
}
Also used : DecimalValue(org.openhab.binding.tinkerforge.internal.types.DecimalValue) NotConnectedException(com.tinkerforge.NotConnectedException) TimeoutException(com.tinkerforge.TimeoutException)

Aggregations

DecimalValue (org.openhab.binding.tinkerforge.internal.types.DecimalValue)92 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)51 NotConnectedException (com.tinkerforge.NotConnectedException)36 TimeoutException (com.tinkerforge.TimeoutException)36 OnOffValue (org.openhab.binding.tinkerforge.internal.types.OnOffValue)3 Position (com.tinkerforge.BrickletJoystick.Position)2 BigDecimal (java.math.BigDecimal)2 Acceleration (com.tinkerforge.BrickletAccelerometer.Acceleration)1 TinkerforgeBindingProvider (org.openhab.binding.tinkerforge.TinkerforgeBindingProvider)1 JoystickXPosition (org.openhab.binding.tinkerforge.internal.model.JoystickXPosition)1 JoystickYPosition (org.openhab.binding.tinkerforge.internal.model.JoystickYPosition)1 DirectionValue (org.openhab.binding.tinkerforge.internal.types.DirectionValue)1 HSBValue (org.openhab.binding.tinkerforge.internal.types.HSBValue)1 HighLowValue (org.openhab.binding.tinkerforge.internal.types.HighLowValue)1 PercentValue (org.openhab.binding.tinkerforge.internal.types.PercentValue)1 ColorItem (org.openhab.core.library.items.ColorItem)1 ContactItem (org.openhab.core.library.items.ContactItem)1 DimmerItem (org.openhab.core.library.items.DimmerItem)1 NumberItem (org.openhab.core.library.items.NumberItem)1 RollershutterItem (org.openhab.core.library.items.RollershutterItem)1