use of org.openhab.binding.tinkerforge.internal.model.LoadCellWeight in project openhab1-addons by openhab.
the class MBrickletLoadCellImpl method initSubDevices.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public void initSubDevices() {
ModelFactory factory = ModelFactory.eINSTANCE;
LoadCellWeight weight = factory.createLoadCellWeight();
weight.setUid(getUid());
String subIdWeight = "weight";
weight.setSubId(subIdWeight);
logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdWeight);
weight.init();
weight.setMbrick(this);
LoadCellLed led = factory.createLoadCellLed();
led.setUid(getUid());
String subIdLed = "led";
led.setSubId(subIdLed);
logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdLed);
led.init();
led.setMbrick(this);
}
use of org.openhab.binding.tinkerforge.internal.model.LoadCellWeight in project openhab1-addons by openhab.
the class TinkerforgeContextImpl method tfLoadCellTare.
@Override
public boolean tfLoadCellTare(String uid) {
if (ecosystem == null) {
logger.error("tfLoadCellTare action failed ecosystem is null");
return false;
}
MBaseDevice mDevice = ecosystem.getDevice(uid, "weight");
if (mDevice instanceof LoadCellWeight) {
logger.trace("load cell tare action");
((LoadCellWeight) mDevice).tare();
return true;
} else {
logger.error("no Load Cell Bricklet found for uid {}", uid);
return false;
}
}
Aggregations