use of org.openhab.binding.tinkerforge.internal.types.OnOffValue in project openhab1-addons by openhab.
the class JoystickButtonImpl 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.JOYSTICK_BUTTON__SENSOR_VALUE, oldSensorValue, sensorValue));
}
use of org.openhab.binding.tinkerforge.internal.types.OnOffValue in project openhab1-addons by openhab.
the class MBrickDCImpl method handleVelocity.
/**
*
* @generated NOT
*/
private void handleVelocity(short velocity, boolean usethreshold) {
DecimalValue newValue = Tools.calculate(velocity);
logger.trace("{} got new value {}", LoggerConstants.TFMODELUPDATE, newValue);
if (usethreshold) {
if (newValue.compareTo(getSensorValue(), getThreshold()) != 0) {
logger.trace("{} setting new value {}", LoggerConstants.TFMODELUPDATE, newValue);
setSensorValue(newValue);
} else {
logger.trace("{} omitting new value {}", LoggerConstants.TFMODELUPDATE, newValue);
}
} else {
logger.trace("{} setting new value {}", LoggerConstants.TFMODELUPDATE, newValue);
setSensorValue(newValue);
}
OnOffValue newSwitchState = newValue.onOffValue(0);
logger.trace("new switchstate {} new value {}", newSwitchState, newValue);
if (newSwitchState != switchState) {
setSwitchState(newSwitchState);
}
}
use of org.openhab.binding.tinkerforge.internal.types.OnOffValue in project openhab1-addons by openhab.
the class MBrickDCImpl 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.MBRICK_DC__SWITCH_STATE, oldSwitchState, switchState));
}
use of org.openhab.binding.tinkerforge.internal.types.OnOffValue in project openhab1-addons by openhab.
the class MLCD20x4BacklightImpl method fetchSwitchState.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void fetchSwitchState() {
OnOffValue switchValue = OnOffValue.UNDEF;
try {
switchValue = brickletLCD20x4.isBacklightOn() ? OnOffValue.ON : OnOffValue.OFF;
setSwitchState(switchValue);
} catch (TimeoutException e) {
TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);
} catch (NotConnectedException e) {
TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);
}
setSwitchState(switchValue);
}
use of org.openhab.binding.tinkerforge.internal.types.OnOffValue in project openhab1-addons by openhab.
the class MLCD20x4ButtonImpl 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.MLCD2_0X4_BUTTON__SENSOR_VALUE, oldSensorValue, sensorValue));
}
Aggregations