Skip to content

Commit

Permalink
Release 1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jghaanstra committed Jan 5, 2018
1 parent 176d1cf commit f2a0590
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions APPSTORE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ For support please use the official support topic on the forum [here](https://fo
- When using multiple IP Webcameras only one global image token is registered and available. This is due to current limitations of Homey core and will hopefully become available in the future.

## Changelog
### 2018-01-05 - v1.2.3
- FIX: really properly fixed the IP Webcam device going offline if no lux sensor is present

### 2017-12-29 - v1.2.2
- FIX: properly fixed the IP Webcam device going offline if no lux sensor is present

Expand Down
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"en": [ "ip webcam", "android" ],
"nl": [ "ip webcam", "android" ]
},
"version": "1.2.2",
"version": "1.2.3",
"compatibility": "1.x >=1.5.0",
"author": {
"name": "Jelger Haanstra",
Expand Down
15 changes: 14 additions & 1 deletion lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ exports.getIpwebcam = function (address, port, username, password) {

if (response.statusCode == 200) {
var data = JSON.parse(response.body);
var lux = 0;

if(data.motion_active.data[0][1][0] == 1) {
var motion = true;
Expand All @@ -73,7 +74,11 @@ exports.getIpwebcam = function (address, port, username, password) {
}

if(data.hasOwnProperty("light")) {
var lux = data.light.data[0][1][0];
if(!isEmpty(data.light.data)) {
var lux = data.light.data[0][1][0];
} else {
var lux = 0;
}
} else {
var lux = 0;
}
Expand Down Expand Up @@ -280,3 +285,11 @@ function getDateTime() {

return { year: year, month: month, day: day, hour: hour, min: min };
}

function isEmpty(obj) {
for(var prop in obj) {
if(obj.hasOwnProperty(prop))
return false;
}
return true;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "android.ipwebcam",
"version": "1.2.2",
"version": "1.2.3",
"description": "Homey app for Android IP Webcam",
"main": "app.js",
"dependencies": {
Expand Down

0 comments on commit f2a0590

Please sign in to comment.