use of org.openhab.binding.tinkerforge.internal.model.RotaryEncoder in project openhab1-addons by openhab.
the class MBrickletRotaryEncoderImpl method initSubDevices.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void initSubDevices() {
RotaryEncoder rotaryEncoder = ModelFactory.eINSTANCE.createRotaryEncoder();
rotaryEncoder.setUid(getUid());
String subIdEncoder = "encoder";
rotaryEncoder.setSubId(subIdEncoder);
logger.debug("addSubDevice {}", subIdEncoder);
rotaryEncoder.init();
rotaryEncoder.setMbrick(this);
RotaryEncoderButton button = ModelFactory.eINSTANCE.createRotaryEncoderButton();
button.setUid(getUid());
String subIdButton = "button";
button.setSubId(subIdButton);
logger.debug("addSubDevice {}", subIdButton);
button.init();
button.setMbrick(this);
}
use of org.openhab.binding.tinkerforge.internal.model.RotaryEncoder in project openhab1-addons by openhab.
the class TinkerforgeContextImpl method tfRotaryEncoderClear.
@Override
public boolean tfRotaryEncoderClear(String uid) {
if (ecosystem == null) {
logger.error("tfRotaryEncoderClear action failed ecosystem is null");
return false;
}
MBaseDevice mDevice = ecosystem.getDevice(uid, "encoder");
if (mDevice instanceof RotaryEncoder) {
logger.trace("rotary encoder clear action");
((RotaryEncoder) mDevice).clear();
return true;
} else {
logger.error("no Rotary Ecoder found for uid {}", uid);
return false;
}
}
Aggregations