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

iobroker.netatmo

Package Overview
Dependencies
Maintainers
3
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 1.3.1 to 1.3.2

0

Gruntfile.js

@@ -0,0 +0,0 @@ // To use this file in WebStorm, right click on the file name in the Project Panel (normally left) and select "Open Grunt Console"

2

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

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

@@ -5,4 +5,4 @@ /* jshint -W097 */// jshint strict:false

var utils = require(__dirname + '/lib/utils');
var adapter = utils.adapter('netatmo');
var utils = require('@iobroker/adapter-core');
var adapter = utils.Adapter('netatmo');

@@ -85,3 +85,3 @@ var netatmo = require('./netatmoLib');

if (!adapter.config.check_interval)
adapter.config.check_interval = 5;
adapter.config.check_interval = 10;

@@ -165,2 +165,2 @@ if (!adapter.config.cleanup_interval)

adapter.log.error("Please add username, password and choose at least one product within the adapter settings!");
});
});

@@ -0,0 +0,0 @@ var util = require('util');

@@ -656,2 +656,5 @@ module.exports = function (myapi, myadapter) {

if (!aModule.dashboard_data)
return;
if (typeof aModule.dashboard_data.WindStrength !== "undefined") {

@@ -658,0 +661,0 @@ adapter.setObjectNotExists(aParent + ".WindStrength", {

@@ -128,2 +128,49 @@ module.exports = function (myapi, myadapter) {

//add events for Presence
//type: 1 human; 2 animal; 3 vehicle
else if (data.event_type === "human") {
adapter.setState(path + "Presence.event", { val: true, ack: true });
adapter.setState(path + "Presence.time", { val: now, ack: true });
adapter.setState(path + "Presence.type", { val: 1, ack: true });
adapter.setState(path + "Presence.typename", { val: data.event_type, ack: true });
adapter.setState(path + "Presence.message", { val: data.message, ack: true });
adapter.setState(path + "Presence.snapshot_url", { val: data.snapshot_url, ack: true });
adapter.setState(path + "Presence.vignette_url", { val: data.vignette_url, ack: true });
adapter.setState(path + "Presence.event_id", { val: data.event_id, ack: true });
adapter.setState(path + "Presence.subevent_id", { val: data.subevent_id, ack: true });
}
else if (data.event_type === "animal") {
adapter.setState(path + "Presence.event", { val: true, ack: true });
adapter.setState(path + "Presence.time", { val: now, ack: true });
adapter.setState(path + "Presence.type", { val: 2, ack: true });
adapter.setState(path + "Presence.typename", { val: data.event_type, ack: true });
adapter.setState(path + "Presence.message", { val: data.message, ack: true });
adapter.setState(path + "Presence.snapshot_url", { val: data.snapshot_url, ack: true });
adapter.setState(path + "Presence.vignette_url", { val: data.vignette_url, ack: true });
adapter.setState(path + "Presence.event_id", { val: data.event_id, ack: true });
adapter.setState(path + "Presence.subevent_id", { val: data.subevent_id, ack: true });
}
else if (data.event_type === "vehicle") {
adapter.setState(path + "Presence.event", { val: true, ack: true });
adapter.setState(path + "Presence.time", { val: now, ack: true });
adapter.setState(path + "Presence.type", { val: 3, ack: true });
adapter.setState(path + "Presence.typename", { val: data.event_type, ack: true });
adapter.setState(path + "Presence.message", { val: data.message, ack: true });
adapter.setState(path + "Presence.snapshot_url", { val: data.snapshot_url, ack: true });
adapter.setState(path + "Presence.vignette_url", { val: data.vignette_url, ack: true });
adapter.setState(path + "Presence.event_id", { val: data.event_id, ack: true });
adapter.setState(path + "Presence.subevent_id", { val: data.subevent_id, ack: true });
}
else if (data.event_type !== "vehicle") {
adapter.setState(path + "Presence.event", { val: false, ack: true });
adapter.setState(path + "Presence.time", { val: null, ack: true });
adapter.setState(path + "Presence.type", { val: null, ack: true });
adapter.setState(path + "Presence.typename", { val: null, ack: true });
adapter.setState(path + "Presence.message", { val: null, ack: true });
adapter.setState(path + "Presence.snapshot_url", { val: null, ack: true });
adapter.setState(path + "Presence.vignette_url", { val: null, ack: true });
adapter.setState(path + "Presence.event_id", { val: null, ack: true });
adapter.setState(path + "Presence.subevent_id", { val: null, ack: true });
}
adapter.setState(path + "LastEventId", {val: data.id, ack: true});

@@ -244,2 +291,120 @@

//create substates for Presence
adapter.setObjectNotExists(homeName + ".LastEventData.Presence.event", {
type: "state",
common: {
name: "event",
type: "boolean",
read: true,
write: false
},
native: {
id: aHome.id
}
});
adapter.setObjectNotExists(homeName + ".LastEventData.Presence.time", {
type: "state",
common: {
name: "time",
type: "string",
read: true,
write: false
},
native: {
id: aHome.id
}
});
adapter.setObjectNotExists(homeName + ".LastEventData.Presence.type", {
type: "state",
common: {
name: "type",
type: "number",
read: true,
write: false
},
native: {
id: aHome.id
}
});
adapter.setObjectNotExists(homeName + ".LastEventData.Presence.typename", {
type: "state",
common: {
name: "typename",
type: "string",
read: true,
write: false
},
native: {
id: aHome.id
}
});
adapter.setObjectNotExists(homeName + ".LastEventData.Presence.message", {
type: "state",
common: {
name: "message",
type: "string",
read: true,
write: false
},
native: {
id: aHome.id
}
});
adapter.setObjectNotExists(homeName + ".LastEventData.Presence.snapshot_url", {
type: "state",
common: {
name: "snapshot_url",
type: "string",
read: true,
write: false
},
native: {
id: aHome.id
}
});
adapter.setObjectNotExists(homeName + ".LastEventData.Presence.vignette_url", {
type: "state",
common: {
name: "vignette_url",
type: "string",
read: true,
write: false
},
native: {
id: aHome.id
}
});
adapter.setObjectNotExists(homeName + ".LastEventData.Presence.event_id", {
type: "state",
common: {
name: "event_id",
type: "string",
read: true,
write: false
},
native: {
id: aHome.id
}
});
adapter.setObjectNotExists(homeName + ".LastEventData.Presence.subevent_id", {
type: "state",
common: {
name: "subevent_id",
type: "string",
read: true,
write: false
},
native: {
id: aHome.id
}
});
adapter.setObjectNotExists(homeName + ".LastEventData", {

@@ -422,2 +587,4 @@ type: "channel",

camera_vpn = aCamera.vpn_url;
adapter.setState(livePath + ".picture", {val: aCamera.vpn_url + "/live/snapshot_720.jpg", ack: true});

@@ -901,2 +1068,112 @@ adapter.setState(livePath + ".stream", {

}
//add event history for Presence with subevent tree
if (aEvent.type === "outdoor") {
var counter = 0;
adapter.setObjectNotExists(fullPath + ".Presence.eventcount", {
type: "state",
common: {
name: "eventcount",
type: "number",
read: true,
write: false
}
});
aEvent.event_list.forEach(function (aEventList) {
// adapter.log.info(JSON.stringify(aEvent));
EventList = aEventList;
counter = counter + 1;
adapter.setState(fullPath + ".Presence.eventcount", { val: counter, ack: true });
adapter.setObjectNotExists(fullPath + ".Presence.event-" + counter + ".message", {
type: "state",
common: {
name: "Type",
type: "string",
read: true,
write: false
}
});
adapter.setState(fullPath + ".Presence.event-" + counter + ".message", { val: EventList.message, ack: true });
adapter.setObjectNotExists(fullPath + ".Presence.event-" + counter + ".type", {
type: "state",
common: {
name: "Type",
type: "number",
read: true,
write: false
}
});
if (EventList.type === "human") {
adapter.setState(fullPath + ".Presence.event-" + counter + ".type", { val: 1, ack: true });
}
else if (EventList.type === "animal") {
adapter.setState(fullPath + ".Presence.event-" + counter + ".type", { val: 2, ack: true });
}
else if (EventList.type === "vehicle") {
adapter.setState(fullPath + ".Presence.event-" + counter + ".type", { val: 3, ack: true });
}
adapter.setObjectNotExists(fullPath + ".Presence.event-" + counter + ".typename", {
type: "state",
common: {
name: "Type",
type: "string",
read: true,
write: false
}
});
adapter.setState(fullPath + ".Presence.event-" + counter + ".typename", { val: EventList.type, ack: true });
adapter.setObjectNotExists(fullPath + ".Presence.event-" + counter + ".time", {
type: "state",
common: {
name: "Time",
type: "date",
read: true,
write: false
}
});
adapter.setState(fullPath + ".Presence.event-" + counter + ".time", { val: (new Date(aEvent.time * 1000)), ack: true });
// val: (new Date(aEvent.time * 1000)),
adapter.setObjectNotExists(fullPath + ".Presence.event-" + counter + ".snapshoturl", {
type: "state",
common: {
name: "Type",
type: "string",
read: true,
write: false
}
});
adapter.setObjectNotExists(fullPath + ".Presence.event-" + counter + ".vignetteurl", {
type: "state",
common: {
name: "Type",
type: "string",
read: true,
write: false
}
});
if (EventList.snapshot.url) {
adapter.setState(fullPath + ".Presence.event-" + counter + ".snapshoturl", { val: EventList.snapshot.url, ack: true });
}
if (EventList.vignette.url) {
adapter.setState(fullPath + ".Presence.event-" + counter + ".vignetteurl", { val: EventList.vignette.url, ack: true });
}
if (EventList.snapshot.filename) {
adapter.setState(fullPath + ".Presence.event-" + counter + ".snapshoturl", { val: camera_vpn + "/" + EventList.snapshot.filename, ack: true });
}
if (EventList.vignette.filename) {
adapter.setState(fullPath + ".Presence.event-" + counter + ".vignetteurl", { val: camera_vpn + "/" + EventList.vignette.filename, ack: true });
}
})
}
}

@@ -903,0 +1180,0 @@

{
"name": "iobroker.netatmo",
"version": "1.3.1",
"version": "1.3.2",
"description": "ioBroker netatmo Adapter",

@@ -34,17 +34,20 @@ "authors": {

"dependencies": {
"@iobroker/adapter-core": "^1.0.3",
"dewpoint": "^1.0.0",
"moment": "^2.18.1",
"request": "^2.81.0",
"socket.io-client": "^1.7.3"
"socket.io-client": "^3.0.1"
},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-replace": "^0.9.3",
"grunt-contrib-jshint": "^0.11.2",
"grunt-jscs": "^2.0.0",
"grunt-http": "^1.6.0",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-compress": "^0.13.0",
"grunt-contrib-copy": "^0.8.0",
"grunt-exec": "^0.4.6"
"grunt": "^1.0.1",
"grunt-replace": "^1.0.1",
"grunt-contrib-jshint": "^1.1.0",
"grunt-jscs": "^3.0.1",
"grunt-http": "^2.2.0",
"grunt-contrib-clean": "^1.1.0",
"grunt-contrib-compress": "^1.4.3",
"grunt-contrib-copy": "^1.0.0",
"grunt-exec": "^3.0.0",
"mocha": "^6.0.2",
"chai": "^4.2.0"
},

@@ -54,3 +57,6 @@ "bugs": {

},
"readmeFilename": "README.md"
"readmeFilename": "README.md",
"scripts": {
"test": "node node_modules/mocha/bin/mocha --exit"
}
}
![Logo](admin/netatmo.png)
# ioBroker.netatmo
[![NPM version](http://img.shields.io/npm/v/iobroker.netatmo.svg)](https://www.npmjs.com/package/iobroker.netatmo)
![Number of Installations](http://iobroker.live/badges/netatmo-installed.svg) ![Number of Installations](http://iobroker.live/badges/netatmo-stable.svg) [![NPM version](http://img.shields.io/npm/v/iobroker.netatmo.svg)](https://www.npmjs.com/package/iobroker.netatmo)
[![Downloads](https://img.shields.io/npm/dm/iobroker.netatmo.svg)](https://www.npmjs.com/package/iobroker.netatmo)

@@ -6,0 +6,0 @@

@@ -0,0 +0,0 @@ var srcDir = __dirname + "/../";

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ var srcDir = __dirname + "/../";

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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