From 1c7260600a8e060035b9ae917860c7731330cddd Mon Sep 17 00:00:00 2001 From: Admin Date: Wed, 1 Feb 2017 11:31:04 -0600 Subject: [PATCH] Minor update for HAL decode issue Fixes #428 --- pom.xml | 2 +- .../java/com/bwssystems/HABridge/plugins/hal/HalInfo.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 55c0a8b7..72d092f8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.bwssystems.HABridge ha-bridge - 4.1.1 + 4.1.2 jar HA Bridge diff --git a/src/main/java/com/bwssystems/HABridge/plugins/hal/HalInfo.java b/src/main/java/com/bwssystems/HABridge/plugins/hal/HalInfo.java index 53b716ee..4b8c693e 100644 --- a/src/main/java/com/bwssystems/HABridge/plugins/hal/HalInfo.java +++ b/src/main/java/com/bwssystems/HABridge/plugins/hal/HalInfo.java @@ -149,8 +149,12 @@ private List getDeviceButtons(List theIrDevices) { theData = httpClient.doHttpRequest(theUrl, null, null, null, null); if (theData != null) { log.debug("GET IrData for IR Device " + theHalDevice.getHaldevicename() + " HalApiResponse - data: " + theData); - theHalApiResponse = new Gson().fromJson(theData, DeviceElements.class); - if (theHalApiResponse.getDeviceElements() == null) { + try { + theHalApiResponse = new Gson().fromJson(theData, DeviceElements.class); + } catch (Exception e) { + theHalApiResponse = null; + } + if (theHalApiResponse == null || theHalApiResponse.getDeviceElements() == null) { StatusDescription theStatus = new Gson().fromJson(theData, StatusDescription.class); if (theStatus.getStatus() == null) { log.warn("Cannot get buttons for IR Device " + theHalDevice.getHaldevicename() + " for hal "