diff --git a/pom.xml b/pom.xml index 55c0a8b..72d092f 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 53b716e..4b8c693 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 @@ public class HalInfo { 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 "