Skip to content

Commit

Permalink
Minor update for HAL decode issue
Browse files Browse the repository at this point in the history
Fixes #428
  • Loading branch information
bwssytems committed Feb 1, 2017
1 parent f1592a1 commit 1c72606
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.bwssystems.HABridge</groupId>
<artifactId>ha-bridge</artifactId>
<version>4.1.1</version>
<version>4.1.2</version>
<packaging>jar</packaging>

<name>HA Bridge</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,12 @@ private List<HalDevice> getDeviceButtons(List<HalDevice> 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 "
Expand Down

0 comments on commit 1c72606

Please sign in to comment.