Search in sources :

Example 1 with BrickletOLED128x64

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

the class MBrickletOLED128x64Impl method setTinkerforgeDevice.

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

Example 2 with BrickletOLED128x64

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

the class MBrickletOLED128x64Impl 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 BrickletOLED128x64(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 : NotConnectedException(com.tinkerforge.NotConnectedException) BrickletOLED128x64(com.tinkerforge.BrickletOLED128x64) MBrickletOLED128x64(org.openhab.binding.tinkerforge.internal.model.MBrickletOLED128x64) TimeoutException(com.tinkerforge.TimeoutException)

Aggregations

BrickletOLED128x64 (com.tinkerforge.BrickletOLED128x64)2 MBrickletOLED128x64 (org.openhab.binding.tinkerforge.internal.model.MBrickletOLED128x64)2 NotConnectedException (com.tinkerforge.NotConnectedException)1 TimeoutException (com.tinkerforge.TimeoutException)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1