dataSets = reader.read();
cache.put(meterName, dataSets);
}
String obis = provider.getObis(itemName);
if (obis != null && dataSets.containsKey(obis)) {
DataSet dataSet = dataSets.get(obis);
if(logger.isDebugEnabled())
logger.debug("Updateing item " + itemName + " with OBIS code " + obis + " and value " + dataSet.getValue());
Class<? extends Item> itemType = provider
.getItemType(itemName);
if (itemType.isAssignableFrom(NumberItem.class)) {
eventPublisher.postUpdate(itemName,
new DecimalType(dataSet.getValue()));
}
if (itemType.isAssignableFrom(StringItem.class)) {
String value = dataSet.getValue();
eventPublisher.postUpdate(itemName, new StringType(
value));
}
}
}