use of com.tinkerforge.BrickletDualButton.ButtonState in project openhab1-addons by openhab.
the class DualButtonButtonImpl method fetchSensorValue.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void fetchSensorValue() {
if (tactile || this.sensorValue == null || this.sensorValue == OnOffValue.UNDEF) {
try {
ButtonState buttonState = tinkerforgeDevice.getButtonState();
OnOffValue newValue;
if (position == DualButtonDevicePosition.LEFT) {
newValue = getValue4State(buttonState.buttonL);
} else {
newValue = getValue4State(buttonState.buttonR);
}
setSensorValue(newValue);
logger.trace("{} fetch value: {}", position, newValue);
} catch (TimeoutException e) {
TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);
} catch (NotConnectedException e) {
TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);
}
} else {
// send current state to update the eventbus
setSensorValue(getSensorValue());
}
}
Aggregations