iobroker.netatmo
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"common": { | ||
"name": "netatmo", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"title": "Netatmo Adapter", | ||
@@ -6,0 +6,0 @@ "desc": { |
@@ -29,6 +29,11 @@ /* jshint -W097 */// jshint strict:false | ||
if (obj.command === "send") { | ||
obj.command = obj.message; | ||
obj.message = null; | ||
} | ||
if (obj) { | ||
switch (obj.command) { | ||
case 'setAway': | ||
if (welcome && obj.message) { | ||
if (welcome) { | ||
welcome.setAway(obj.message); | ||
@@ -35,0 +40,0 @@ } |
@@ -33,3 +33,3 @@ module.exports = function (myapi, myadapter) { | ||
handleDevice(aDevice, aParent); | ||
} else { | ||
} else if (aDevice.module_name) { | ||
var deviceName = getDeviceName(aDevice.module_name); | ||
@@ -59,2 +59,4 @@ var fullPath = aParent ? aParent + "." + deviceName : deviceName; | ||
}); | ||
} else { | ||
myadapter.log.warn("UNKNOWN MODULE " + JSON.stringify(aModule)); | ||
} | ||
@@ -61,0 +63,0 @@ } |
@@ -13,2 +13,3 @@ module.exports = function (myapi, myadapter) { | ||
var knownPeople = []; | ||
var homeIds = []; | ||
@@ -40,6 +41,15 @@ var socket = null; | ||
this.setAway = function (data) { | ||
api.setPersonsAway(data.homeId, data.personsId, function (err, data) { | ||
if (err !== null) | ||
adapter.log.error(err); | ||
}); | ||
if (data && data.homeId) { | ||
api.setPersonsAway(data.homeId, data.personsId, function (err, data) { | ||
if (err !== null) | ||
adapter.log.error(err); | ||
}); | ||
} else { | ||
homeIds.forEach(function (aHomeId) { | ||
api.setPersonsAway(aHomeId, data ? data.personsId : null, function (err, data) { | ||
if (err !== null) | ||
adapter.log.error(err); | ||
}); | ||
}); | ||
} | ||
}; | ||
@@ -53,2 +63,3 @@ | ||
var homes = data.homes; | ||
homeIds = []; | ||
@@ -81,4 +92,2 @@ if (Array.isArray(homes)) { | ||
function onSocketAlert(data) { | ||
adapter.log.info("received a realtime event ..."); | ||
var now = (new Date()).toISOString(); | ||
@@ -127,2 +136,4 @@ | ||
homeIds.push(aHome.id); | ||
// Join HomeID | ||
@@ -974,2 +985,2 @@ if (socket) { | ||
} | ||
}; | ||
} |
{ | ||
"name": "iobroker.netatmo", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "ioBroker netatmo Adapter", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -18,5 +18,9 @@ ![Logo](admin/netatmo.png) | ||
``` | ||
or | ||
``` | ||
sendTo('netatmo.0', "setAway"); | ||
``` | ||
to mark all persons as away for all cameras | ||
it's also possible to mark one or more specific persons as away | ||
``` | ||
@@ -26,9 +30,12 @@ sendTo('netatmo.0', "setAway", {homeId: '1234567890abcdefg', personsId: ['123123123123123']}); | ||
The parameter homeId is the string listed behind the name of your Camera within the Objects tab, | ||
the personsId is the face_id within the "Known" persons folder | ||
The parameter homeId is the string listed behind the name of your Camera within the Objects tab (optional, if multiple cameras are installed), | ||
the personsId is the id within the "Known" persons folder | ||
## Changelog | ||
### 1.1.1 | ||
* (PArns) Simplified setAway | ||
### 1.1.0 | ||
* (PArns) Added setAway function (Welcome only) to set all or specific persons as away (requires your own API key!) | ||
* (PArns) Added setAway function (Welcome only) to mark all or specific persons as away (requires your own API key!) | ||
@@ -35,0 +42,0 @@ ### 1.0.1 |
114774
1891
110