Search in sources :

Example 1 with BrickletOLED64x48

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

the class MBrickletOLE64x48Impl method enable.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     *
     * @generated NOT
     */
@Override
public void enable() {
    if (tfConfig != null) {
        if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature("contrast"))) {
            Short contrast = tfConfig.getContrast();
            logger.debug("contrast {}", contrast);
            setContrast(contrast);
        }
        if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature("invert"))) {
            boolean invert = tfConfig.isInvert();
            logger.debug("invert {}", invert);
            setInvert(invert);
        }
    }
    try {
        tinkerforgeDevice = new BrickletOLED64x48(getUid(), getIpConnection());
        tinkerforgeDevice.setDisplayConfiguration(getContrast(), isInvert());
    } 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 : BrickletOLED64x48(com.tinkerforge.BrickletOLED64x48) NotConnectedException(com.tinkerforge.NotConnectedException) TimeoutException(com.tinkerforge.TimeoutException)

Example 2 with BrickletOLED64x48

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

the class MBrickletOLE64x48Impl method setTinkerforgeDevice.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     *
     * @generated
     */
@Override
public void setTinkerforgeDevice(BrickletOLED64x48 newTinkerforgeDevice) {
    BrickletOLED64x48 oldTinkerforgeDevice = tinkerforgeDevice;
    tinkerforgeDevice = newTinkerforgeDevice;
    if (eNotificationRequired()) {
        eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.MBRICKLET_OLE6_4X48__TINKERFORGE_DEVICE, oldTinkerforgeDevice, tinkerforgeDevice));
    }
}
Also used : BrickletOLED64x48(com.tinkerforge.BrickletOLED64x48) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Aggregations

BrickletOLED64x48 (com.tinkerforge.BrickletOLED64x48)2 NotConnectedException (com.tinkerforge.NotConnectedException)1 TimeoutException (com.tinkerforge.TimeoutException)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1