Search in sources :

Example 1 with Position

use of com.tinkerforge.BrickletJoystick.Position in project openhab1-addons by openhab.

the class JoystickYPositionImpl method fetchSensorValue.

/**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void fetchSensorValue() {
    try {
        Position position = tinkerforgeDevice.getPosition();
        DecimalValue value = Tools.calculate(position.y);
        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) Position(com.tinkerforge.BrickletJoystick.Position) JoystickYPosition(org.openhab.binding.tinkerforge.internal.model.JoystickYPosition) TimeoutException(com.tinkerforge.TimeoutException)

Example 2 with Position

use of com.tinkerforge.BrickletJoystick.Position 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);
    }
}
Also used : DecimalValue(org.openhab.binding.tinkerforge.internal.types.DecimalValue) NotConnectedException(com.tinkerforge.NotConnectedException) Position(com.tinkerforge.BrickletJoystick.Position) JoystickXPosition(org.openhab.binding.tinkerforge.internal.model.JoystickXPosition) TimeoutException(com.tinkerforge.TimeoutException)

Aggregations

Position (com.tinkerforge.BrickletJoystick.Position)2 NotConnectedException (com.tinkerforge.NotConnectedException)2 TimeoutException (com.tinkerforge.TimeoutException)2 DecimalValue (org.openhab.binding.tinkerforge.internal.types.DecimalValue)2 JoystickXPosition (org.openhab.binding.tinkerforge.internal.model.JoystickXPosition)1 JoystickYPosition (org.openhab.binding.tinkerforge.internal.model.JoystickYPosition)1