mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-19 08:28:46 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c7260600a | ||
|
|
f1592a1998 |
2
pom.xml
2
pom.xml
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.bwssystems.HABridge</groupId>
|
<groupId>com.bwssystems.HABridge</groupId>
|
||||||
<artifactId>ha-bridge</artifactId>
|
<artifactId>ha-bridge</artifactId>
|
||||||
<version>4.1.1</version>
|
<version>4.1.2</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>HA Bridge</name>
|
<name>HA Bridge</name>
|
||||||
|
|||||||
@@ -220,19 +220,22 @@ public class DeviceDescriptor{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean containsType(String aType) {
|
public boolean containsType(String aType) {
|
||||||
if(this.mapType.contains(aType))
|
if(aType == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if(this.mapType != null && this.mapType.contains(aType))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if(this.deviceType.contains(aType))
|
if(this.deviceType != null && this.deviceType.contains(aType))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if(this.onUrl.contains(aType))
|
if(this.onUrl != null && this.onUrl.contains(aType))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if(this.dimUrl.contains(aType))
|
if(this.dimUrl != null && this.dimUrl.contains(aType))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if(this.offUrl.contains(aType))
|
if(this.offUrl != null && this.offUrl.contains(aType))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -149,8 +149,12 @@ public class HalInfo {
|
|||||||
theData = httpClient.doHttpRequest(theUrl, null, null, null, null);
|
theData = httpClient.doHttpRequest(theUrl, null, null, null, null);
|
||||||
if (theData != null) {
|
if (theData != null) {
|
||||||
log.debug("GET IrData for IR Device " + theHalDevice.getHaldevicename() + " HalApiResponse - data: " + theData);
|
log.debug("GET IrData for IR Device " + theHalDevice.getHaldevicename() + " HalApiResponse - data: " + theData);
|
||||||
theHalApiResponse = new Gson().fromJson(theData, DeviceElements.class);
|
try {
|
||||||
if (theHalApiResponse.getDeviceElements() == null) {
|
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);
|
StatusDescription theStatus = new Gson().fromJson(theData, StatusDescription.class);
|
||||||
if (theStatus.getStatus() == null) {
|
if (theStatus.getStatus() == null) {
|
||||||
log.warn("Cannot get buttons for IR Device " + theHalDevice.getHaldevicename() + " for hal "
|
log.warn("Cannot get buttons for IR Device " + theHalDevice.getHaldevicename() + " for hal "
|
||||||
|
|||||||
Reference in New Issue
Block a user