use of org.openhab.binding.tinkerforge.internal.types.OnOffValue in project openhab1-addons by openhab.
the class MDualRelayImpl 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.MDUAL_RELAY__SWITCH_STATE, oldSwitchState, switchState));
}
use of org.openhab.binding.tinkerforge.internal.types.OnOffValue in project openhab1-addons by openhab.
the class MDualRelayImpl method fetchSwitchState.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void fetchSwitchState() {
OnOffValue switchValue = OnOffValue.UNDEF;
try {
State state = getMbrick().getTinkerforgeDevice().getState();
if (relayNum == 1) {
switchValue = (state.relay1) ? OnOffValue.ON : OnOffValue.OFF;
} else {
switchValue = (state.relay2) ? 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 MIndustrialQuadRelayImpl method fetchSwitchState.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void fetchSwitchState() {
OnOffValue value = OnOffValue.UNDEF;
try {
int deviceValue = getMbrick().getTinkerforgeDevice().getValue();
if ((deviceValue & mask) == mask) {
value = OnOffValue.ON;
} else {
value = OnOffValue.OFF;
}
setSwitchState(value);
} catch (TimeoutException e) {
TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);
} catch (NotConnectedException e) {
TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);
}
}
use of org.openhab.binding.tinkerforge.internal.types.OnOffValue in project openhab1-addons by openhab.
the class MIndustrialQuadRelayImpl 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.MINDUSTRIAL_QUAD_RELAY__SWITCH_STATE, oldSwitchState, switchState));
}
use of org.openhab.binding.tinkerforge.internal.types.OnOffValue in project openhab1-addons by openhab.
the class RotaryEncoderButtonImpl 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.ROTARY_ENCODER_BUTTON__SENSOR_VALUE, oldSensorValue, sensorValue));
}
Aggregations