use of org.openhab.binding.sapp.internal.model.SappPnmas in project openhab1-addons by openhab.
the class SappBinding method getOutputValue.
/**
* load output value from pnmas, if not cached, and caches it
*/
private int getOutputValue(SappBindingProvider provider, String pnmasId, int address, String subAddress, boolean forceReload) throws SappException {
Integer value = provider.getOutputCachedValue(address);
if (forceReload || value == null) {
logger.debug("cached value missing, reloading for [{} {} {}]", pnmasId, address, subAddress);
SappPnmas pnmas = provider.getPnmasMap().get(pnmasId);
SappCentralExecuter sappCentralExecuter = SappCentralExecuter.getInstance();
value = sappCentralExecuter.executeSapp75Command(pnmas.getIp(), pnmas.getPort(), (byte) address);
provider.setOutputCachedValue(address, value);
}
return value.intValue();
}
Aggregations