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));
}
}
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);
}
}
Aggregations