Source:
public void handleEvent(Item item, DSCAlarmBindingConfig config, EventPublisher publisher, DSCAlarmEvent event) { APIMessage apiMessage = null; int apiCode = -1; boolean boolState; int state = 0; OnOffType onOffType; if (event != null) { apiMessage = event.getAPIMessage(); apiCode = Integer.parseInt(apiMessage.getAPICode()); String str = ""; logger.debug("handleEvent(): Panel Item Name: {}", item.getName()); if (config != null) { if (config.getDSCAlarmItemType() != null) { switch (config.getDSCAlarmItemType()) { case PANEL_CONNECTION: publisher.postUpdate(item.getName(), new DecimalType(state)); break; case PANEL_MESSAGE: if (apiMessage != null) { str = apiMessage.getAPIDescription(); } publisher.postUpdate(item.getName(), new StringType(str)); break; case PANEL_SYSTEM_ERROR: int systemErrorCode = 0; if (apiMessage != null) { systemErrorCode = Integer.parseInt(apiMessage.getAPIData()); str = String.format("%03d", systemErrorCode) + ": " + apiMessage.getError(); publisher.postUpdate(item.getName(), new StringType(str)); } break; case PANEL_TROUBLE_MESSAGE: if (apiMessage != null) { str = apiMessage.getAPIDescription(); } publisher.postUpdate(item.getName(), new StringType(str)); break; case PANEL_TROUBLE_LED: if (apiMessage != null) { boolState = (apiCode == 840) ? true : false; onOffType = boolState ? OnOffType.ON : OnOffType.OFF; publisher.postUpdate(item.getName(), onOffType); } break; case PANEL_TIME: if (apiMessage != null) { str = getFormattedPanelTime(apiMessage.getAPIData()); publisher.postUpdate(item.getName(), new DateTimeType(str)); } break; default: logger.debug("handleEvent(): Panel item not updated."); break; } } } } }

Target:
public void handleEvent(Item item, DSCAlarmBindingConfig config, EventPublisher publisher, DSCAlarmEvent event) { APIMessage apiMessage = null; int apiCode = -1; boolean boolState; int state = 0; OnOffType onOffType; if (event != null) { apiMessage = event.getAPIMessage(); apiCode = Integer.parseInt(apiMessage.getAPICode()); String str = ""; logger.debug("handleEvent(): Panel Item Name: {}", item.getName()); if (config != null) { if (config.getDSCAlarmItemType() != null) { switch (config.getDSCAlarmItemType()) { case PANEL_CONNECTION: publisher.postUpdate(item.getName(), new DecimalType(state)); break; case PANEL_MESSAGE: if (apiMessage != null) { str = apiMessage.getAPIDescription(); } publisher.postUpdate(item.getName(), new StringType(str)); break; case PANEL_SYSTEM_ERROR: int systemErrorCode = 0; if (apiMessage != null) { systemErrorCode = Integer.parseInt(apiMessage.getAPIData()); str = String.format("%03d: %s", systemErrorCode, apiMessage.getError()); publisher.postUpdate(item.getName(), new StringType(str)); } break; case PANEL_TROUBLE_MESSAGE: if (apiMessage != null) { str = apiMessage.getAPIDescription(); } publisher.postUpdate(item.getName(), new StringType(str)); break; case PANEL_TROUBLE_LED: if (apiMessage != null) { boolState = (apiCode == 840) ? true : false; onOffType = boolState ? OnOffType.ON : OnOffType.OFF; publisher.postUpdate(item.getName(), onOffType); } break; case PANEL_TIME: if (apiMessage != null) { str = getFormattedPanelTime(apiMessage.getAPIData()); publisher.postUpdate(item.getName(), new DateTimeType(str)); } break; default: logger.debug("handleEvent(): Panel item not updated."); break; } } } } }