*/
protected void internalUpdateItem(String slaveName, InputRegister[] registers,
String itemName) {
for (ModbusBindingProvider provider : providers) {
if (provider.providesBindingFor(itemName)) {
ModbusBindingConfig config = provider.getConfig(itemName);
if (config.slaveName.equals(slaveName)) {
String slaveValueType = modbusSlaves.get(slaveName).getValueType();
State newState = extractStateFromRegisters(registers, config.readRegister, slaveValueType);
if (config.getItem() instanceof SwitchItem) {
newState = newState.equals(DecimalType.ZERO) ? OnOffType.OFF : OnOffType.ON;
}
State currentState = config.getItemState();
if (! newState.equals(currentState))
eventPublisher.postUpdate(itemName, newState);
}
}
}