Search in sources :

Example 6 with HighLowValue

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

the class MultiTouchDeviceImpl method fetchSensorValue.

/**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void fetchSensorValue() {
    HighLowValue value = HighLowValue.UNDEF;
    try {
        value = extractValue(getMbrick().getTinkerforgeDevice().getTouchState());
        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 : NotConnectedException(com.tinkerforge.NotConnectedException) HighLowValue(org.openhab.binding.tinkerforge.internal.types.HighLowValue) TimeoutException(com.tinkerforge.TimeoutException)

Example 7 with HighLowValue

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

the class PTCConnectedImpl method fetchSensorValue.

/**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void fetchSensorValue() {
    try {
        boolean sensorConnected = tinkerforgeDevice.isSensorConnected();
        HighLowValue newValue = sensorConnected ? HighLowValue.LOW : HighLowValue.HIGH;
        setSensorValue(newValue);
    } 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 : NotConnectedException(com.tinkerforge.NotConnectedException) HighLowValue(org.openhab.binding.tinkerforge.internal.types.HighLowValue) TimeoutException(com.tinkerforge.TimeoutException)

Example 8 with HighLowValue

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

the class LaserRangeFinderLaserImpl method fetchDigitalValue.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated NOT
     */
@Override
public void fetchDigitalValue() {
    try {
        HighLowValue value = tinkerforgeDevice.isLaserEnabled() ? HighLowValue.HIGH : HighLowValue.LOW;
        setDigitalState(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 : NotConnectedException(com.tinkerforge.NotConnectedException) HighLowValue(org.openhab.binding.tinkerforge.internal.types.HighLowValue) TimeoutException(com.tinkerforge.TimeoutException)

Example 9 with HighLowValue

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

the class LaserRangeFinderLaserImpl method setDigitalState.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated
     */
@Override
public void setDigitalState(HighLowValue newDigitalState) {
    HighLowValue oldDigitalState = digitalState;
    digitalState = newDigitalState;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.LASER_RANGE_FINDER_LASER__DIGITAL_STATE, oldDigitalState, digitalState));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) HighLowValue(org.openhab.binding.tinkerforge.internal.types.HighLowValue)

Example 10 with HighLowValue

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

the class DualButtonLedImpl method setDigitalState.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated
     */
@Override
public void setDigitalState(HighLowValue newDigitalState) {
    HighLowValue oldDigitalState = digitalState;
    digitalState = newDigitalState;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DUAL_BUTTON_LED__DIGITAL_STATE, oldDigitalState, digitalState));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) HighLowValue(org.openhab.binding.tinkerforge.internal.types.HighLowValue)

Aggregations

HighLowValue (org.openhab.binding.tinkerforge.internal.types.HighLowValue)33 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)17 NotConnectedException (com.tinkerforge.NotConnectedException)14 TimeoutException (com.tinkerforge.TimeoutException)14 TinkerforgeBindingProvider (org.openhab.binding.tinkerforge.TinkerforgeBindingProvider)2 OnOffValue (org.openhab.binding.tinkerforge.internal.types.OnOffValue)2 PercentType (org.openhab.core.library.types.PercentType)2 DigitalActor (org.openhab.binding.tinkerforge.internal.model.DigitalActor)1 DimmableActor (org.openhab.binding.tinkerforge.internal.model.DimmableActor)1 MBaseDevice (org.openhab.binding.tinkerforge.internal.model.MBaseDevice)1 MSwitchActor (org.openhab.binding.tinkerforge.internal.model.MSwitchActor)1 MTextActor (org.openhab.binding.tinkerforge.internal.model.MTextActor)1 MoveActor (org.openhab.binding.tinkerforge.internal.model.MoveActor)1 NumberActor (org.openhab.binding.tinkerforge.internal.model.NumberActor)1 PercentTypeActor (org.openhab.binding.tinkerforge.internal.model.PercentTypeActor)1 ProgrammableColorActor (org.openhab.binding.tinkerforge.internal.model.ProgrammableColorActor)1 ProgrammableSwitchActor (org.openhab.binding.tinkerforge.internal.model.ProgrammableSwitchActor)1 SetPointActor (org.openhab.binding.tinkerforge.internal.model.SetPointActor)1 SimpleColorActor (org.openhab.binding.tinkerforge.internal.model.SimpleColorActor)1 DecimalValue (org.openhab.binding.tinkerforge.internal.types.DecimalValue)1