use of org.openhab.binding.tinkerforge.internal.types.OnOffValue in project openhab1-addons by openhab.
the class RotaryEncoderButtonImpl method fetchSensorValue.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void fetchSensorValue() {
if (tactile || this.sensorValue == null || this.sensorValue == OnOffValue.UNDEF) {
try {
OnOffValue value = tinkerforgeDevice.isPressed() ? OnOffValue.ON : OnOffValue.OFF;
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);
}
} else {
// send current state to update the eventbus
setSensorValue(getSensorValue());
}
}
use of org.openhab.binding.tinkerforge.internal.types.OnOffValue in project openhab1-addons by openhab.
the class DualButtonButtonImpl method setSensorValue.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setSensorValue(OnOffValue newSensorValue) {
OnOffValue oldSensorValue = sensorValue;
sensorValue = newSensorValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DUAL_BUTTON_BUTTON__SENSOR_VALUE, oldSensorValue, sensorValue));
}
use of org.openhab.binding.tinkerforge.internal.types.OnOffValue 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());
}
}
use of org.openhab.binding.tinkerforge.internal.types.OnOffValue in project openhab1-addons by openhab.
the class LEDGroupImpl method setSwitchState.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setSwitchState(OnOffValue newSwitchState) {
OnOffValue oldSwitchState = switchState;
switchState = newSwitchState;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.LED_GROUP__SWITCH_STATE, oldSwitchState, switchState));
}
use of org.openhab.binding.tinkerforge.internal.types.OnOffValue in project openhab1-addons by openhab.
the class JoystickButtonImpl method fetchSensorValue.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void fetchSensorValue() {
if (tactile || this.sensorValue == null || this.sensorValue == OnOffValue.UNDEF) {
try {
OnOffValue value = tinkerforgeDevice.isPressed() ? OnOffValue.ON : OnOffValue.OFF;
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);
}
} else {
// send current state to update the eventbus
setSensorValue(getSensorValue());
}
}
Aggregations