Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

iobroker.netatmo

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iobroker.netatmo - npm Package Compare versions

Comparing version 0.6.1 to 1.0.0

2

io-package.json
{
"common": {
"name": "netatmo",
"version": "0.6.1",
"version": "1.0.0",
"title": "Netatmo Adapter",

@@ -6,0 +6,0 @@ "desc": {

@@ -68,3 +68,3 @@ /* jshint -W097 */// jshint strict:false

if (adapter.config.netatmoWelcome) {
scope += " read_camera";
scope += " read_camera access_camera";
}

@@ -71,0 +71,0 @@

@@ -12,2 +12,4 @@ module.exports = function (myapi, myadapter) {

var knownPeople = [];
var socket = null;

@@ -81,4 +83,5 @@ var that = null;

if (person.is_known)
if (person.is_known) {
dataPath = "LastKnownPersonSeen";
}
else

@@ -88,2 +91,11 @@ dataPath = "LastUnknownPersonSeen";

adapter.setState(path + dataPath, {val: now, ack: true});
// Set state first ...
if (person.is_known) {
knownPeople.forEach(function (aPerson) {
if (aPerson.face && aPerson.face.id === person.face_id) {
adapter.setState(path + "LastKnownPersonName", {val: aPerson.pseudo, ack: true});
}
})
}
});

@@ -151,2 +163,15 @@

adapter.setObjectNotExists(homeName + ".LastEventData.LastKnownPersonName", {
type: "state",
common: {
name: "LastKnownPersonName",
type: "string",
read: true,
write: false
},
native: {
id: aHome.id
}
});
adapter.setObjectNotExists(homeName + ".LastEventData.LastUnknownPersonSeen", {

@@ -200,2 +225,4 @@ type: "state",

if (aHome.persons) {
knownPeople = [];
aHome.persons.forEach(function (aPerson) {

@@ -214,6 +241,2 @@ handlePerson(aPerson, homeName);

function getCameraName(aCameraName) {
return aCameraName.replaceAll(" ", "-").replaceAll("---", "-").replaceAll("--", "-");
}
function handleCamera(aCamera, aHome) {

@@ -224,2 +247,3 @@

var infoPath = fullPath + ".info";
var livePath = fullPath + ".live";

@@ -259,3 +283,3 @@

name: "Monitoring State (on/off)",
type: "state",
type: "string",
read: true,

@@ -277,8 +301,5 @@ write: false

name: "SD card State (on/off)",
type: "state",
type: "string",
read: true,
write: false
},
native: {
sd_status: aCamera.sd_status
}

@@ -295,8 +316,5 @@ });

name: "Power Supply State (on/off)",
type: "state",
type: "string",
read: true,
write: false
},
native: {
alim_status: aCamera.alim_status
}

@@ -316,5 +334,2 @@ });

write: false
},
native: {
name: aCamera.name
}

@@ -326,2 +341,30 @@ });

if (aCamera.vpn_url) {
adapter.setObjectNotExists(livePath + ".picture", {
type: "state",
common: {
name: "Live camera picture URL",
type: "string",
read: true,
write: false
}
});
adapter.setObjectNotExists(livePath + ".stream", {
type: "state",
common: {
name: "Live camera picture URL",
type: "string",
read: true,
write: false
}
});
adapter.setState(livePath + ".picture", {val: aCamera.vpn_url + "/live/snapshot_720.jpg", ack: true});
adapter.setState(livePath + ".stream", {
val: aCamera.vpn_url + (aCamera.is_local ? "/live/index_local.m3u8" : "/live/index.m3u8"),
ack: true
});
}
// Initialize Camera Place

@@ -391,3 +434,3 @@ if (aHome.place) {

function getPersonName(aPersonName, aParent) {
function getPersonName(aPersonName) {
return aPersonName.replaceAll(" ", "-").replaceAll("---", "-").replaceAll("--", "-").replaceAll("ß", "ss");

@@ -426,2 +469,3 @@ }

fullPath += ".Known";
knownPeople.push(aPerson);
}

@@ -477,3 +521,3 @@ else {

name: "Person out of sight (true/false)",
type: "state",
type: "string",
read: true,

@@ -489,3 +533,3 @@ write: false

name: "Person at home (true/false)",
type: "state",
type: "string",
read: true,

@@ -554,41 +598,18 @@ write: false

if (aFace.id && aFace.key) {
var imageUrl = "https://api.netatmo.com/api/getcamerapicture?image_id=" + aFace.id + "&key=" + aFace.key;
api.getCameraPicture({"image_id": aFace.id, "key": aFace.key}, function (err, data) {
if (err !== null)
adapter.log.error(err);
else {
adapter.setObjectNotExists(fullPath + ".face_url", {
type: "state",
common: {
name: "Face Url",
type: "string",
read: true,
write: false
},
native: {
vis_url: "http://<vis-url>:<vis-port>/state/" + adapter.namespace + "." + fullPath + ".jpg"
}
});
adapter.setState(fullPath + ".face_url", {
val: adapter.namespace + "." + fullPath + ".jpg",
ack: true
});
adapter.setObjectNotExists(fullPath + ".jpg", {
type: "state",
common: {
name: "JPEG",
type: "object",
read: true,
write: false
},
native: {
vis_url: "http://<vis-url>:<vis-port>/state/" + adapter.namespace + "." + fullPath + ".jpg"
}
});
adapter.setBinaryState(adapter.namespace + "." + fullPath + ".jpg", data);
adapter.setObjectNotExists(fullPath + ".face_url", {
type: "state",
common: {
name: "Face Url",
type: "string",
read: true,
write: false
}
});
adapter.setState(fullPath + ".face_url", {
val: imageUrl,
ack: true
});
}

@@ -595,0 +616,0 @@

{
"name": "iobroker.netatmo",
"version": "0.6.1",
"version": "1.0.0",
"description": "ioBroker netatmo Adapter",

@@ -5,0 +5,0 @@ "author": {

@@ -16,2 +16,9 @@ ![Logo](admin/netatmo.png)

### 1.0.0
* (PArns) Added live camera picture & stream for presence & welcome
* (PArns) Fixed known & unknown face image url for presence & welcome
### 0.6.2
* (PArns) Added name of last seen known face
### 0.6.1

@@ -18,0 +25,0 @@ * (PArns) Changed realtime server to use new general realtime server

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc