Skip to content

Commit

Permalink
Fix issue with DewPoint NaN float #528
Browse files Browse the repository at this point in the history
Fix issue with DewPoint NaN float #528
  • Loading branch information
Mark Heinis committed Jun 14, 2019
1 parent 0e46759 commit 774d27a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/version.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Fri Jun 14 15:38:04 CEST 2019
VERSION_BUILD=5910
#Fri Jun 14 15:47:17 CEST 2019
VERSION_BUILD=5911
VERSION_PATCH=110
VERSION_CODE=426
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,29 @@ public DevicesInfo(JSONObject row) throws JSONException {
Chill = row.getString("Chill");
if (row.has("Speed"))
Speed = row.getString("Speed");
if (row.has("DewPoint"))
DewPoint = row.getLong("DewPoint");
if (row.has("Temp"))
Temp = row.getLong("Temp");
if (row.has("Barometer"))
Barometer = row.getInt("Barometer");

if (row.has("DewPoint")) {
try {
DewPoint = row.getLong("DewPoint");
} catch (Exception ex) {
DewPoint = 0;
}
}
if (row.has("Temp")) {
try {
Temp = row.getLong("Temp");
} catch (Exception ex) {
Temp = 0;
}
}
if (row.has("Barometer")) {
try {
Barometer = row.getInt("Barometer");
} catch (Exception ex) {
Barometer = 0;
}
}

if (row.has("Description"))
Description = row.getString("Description");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ public TemperatureInfo(JSONObject row) throws JSONException {
try {
if (row.has("Temp"))
Temp = row.getDouble("Temp");
}catch(Exception ex){}
}catch(Exception ex){
Temp = 0;
}

if (row.has("LastUpdate"))
LastUpdate = row.getString("LastUpdate");
Expand All @@ -75,8 +77,15 @@ public TemperatureInfo(JSONObject row) throws JSONException {
TypeImg = row.getString("TypeImg");
if (row.has("DirectionStr"))
Direction = row.getString("DirectionStr");
if (row.has("SetPoint"))
setPoint = row.getDouble("SetPoint");

if (row.has("SetPoint")) {
try {
setPoint = row.getDouble("SetPoint");
} catch (Exception ex) {
setPoint = 0;
}
}

if (row.has("Name"))
Name = row.getString("Name");
if (row.has("Description"))
Expand Down
2 changes: 1 addition & 1 deletion domoticzapi/version.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Fri Jun 14 15:38:04 CEST 2019
#Fri Jun 14 15:47:17 CEST 2019
VERSION_BUILD=3675
VERSION_PATCH=219
VERSION_CODE=219

0 comments on commit 774d27a

Please sign in to comment.