mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-25 10:13:34 +00:00
Updated math variable execution to use net.java.dev.eval package. Safer
and more robust than using JavaScript Engine Eval. Also, added checks if a default vera address is uses , "1.1.1.1", that we ignore the vera helpers to not throw errors.
This commit is contained in:
@@ -26,14 +26,19 @@ public class VeraInfo {
|
||||
private HttpClient httpClient;
|
||||
private static final String SDATA_REQUEST = ":3480/data_request?id=sdata&output_format=json";
|
||||
private String veraAddressString;
|
||||
private Boolean validVera;
|
||||
|
||||
public VeraInfo(String addressString) {
|
||||
public VeraInfo(String addressString, Boolean isValidVera) {
|
||||
super();
|
||||
httpClient = HttpClients.createMinimal();
|
||||
veraAddressString = addressString;
|
||||
validVera = isValidVera;
|
||||
}
|
||||
|
||||
public Sdata getSdata() {
|
||||
if(!validVera)
|
||||
return new Sdata();
|
||||
|
||||
String theUrl = "http://" + veraAddressString + SDATA_REQUEST;
|
||||
String theData;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user