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.3 to 1.4.0

admin/jsonConfig.json

125

io-package.json
{
"common": {
"name": "netatmo",
"version": "1.3.3",
"title": "Netatmo Adapter",
"desc": {
"en": "ioBroker netatmo Adapter",
"de": "ioBroker Netatmo Adapter",
"ru": "ioBroker Netatmo драйвер как образец"
"common": {
"name": "netatmo",
"version": "1.4.0",
"title": "Netatmo",
"titleLang": {
"en": "Netatmo"
},
"news": {
"1.4.0": {
"en": "Added the support of admin5 \nRemoved warnings about the type of states",
"de": "Unterstützung von admin5 . hinzugefügt\nWarnungen über die Art der Zustände entfernt",
"ru": "Добавлена поддержка admin5\nУбраны предупреждения о типе состояний",
"pt": "Adicionado o suporte de admin5\nRemoção de avisos sobre o tipo de estado",
"nl": "Ondersteuning toegevoegd van admin5\nWaarschuwingen over het type toestanden verwijderd",
"fr": "Ajout du support d'admin5\nSuppression des avertissements sur le type d'états",
"it": "Aggiunto il supporto di admin5\nRimossi gli avvisi sul tipo di stati",
"es": "Se agregó el soporte de admin5.\nSe eliminaron las advertencias sobre el tipo de estados.",
"pl": "Dodano wsparcie admin5\nUsunięto ostrzeżenia o rodzaju stanów",
"zh-cn": "增加了admin5的支持\n删除了关于状态类型的警告"
},
"1.3.4": {
"en": "Added the support of admin5 \nRemoved warnings about the type of states",
"de": "Unterstützung von admin5 . hinzugefügt\nWarnungen über die Art der Zustände entfernt",
"ru": "Добавлена поддержка admin5\nУбраны предупреждения о типе состояний",
"pt": "Adicionado o suporte de admin5\nRemoção de avisos sobre o tipo de estado",
"nl": "Ondersteuning toegevoegd van admin5\nWaarschuwingen over het type toestanden verwijderd",
"fr": "Ajout du support d'admin5\nSuppression des avertissements sur le type d'états",
"it": "Aggiunto il supporto di admin5\nRimossi gli avvisi sul tipo di stati",
"es": "Se agregó el soporte de admin5.\nSe eliminaron las advertencias sobre el tipo de estados.",
"pl": "Dodano wsparcie admin5\nUsunięto ostrzeżenia o rodzaju stanów",
"zh-cn": "增加了admin5的支持\n删除了关于状态类型的警告"
},
"1.3.3": {
"en": "removed person history"
}
},
"desc": {
"en": "netatmo",
"de": "Netatmo",
"ru": "Netatmo"
},
"license": "MIT",
"platform": "Javascript/Node.js",
"mode": "daemon",
"icon": "netatmo.png",
"compact": true,
"connectionType": "cloud",
"dataSource": "push",
"enabled": false,
"messagebox": true,
"adminUI": {
"config": "json"
},
"extIcon": "https://raw.githubusercontent.com/PArns/ioBroker.netatmo/master/admin/netatmo.png",
"keywords": [
"netatmo"
],
"readme": "https://github.com/PArns/ioBroker.netatmo/blob/master/README.md",
"loglevel": "info",
"type": "weather",
"authors": [
"Patrick Arns <iobroker@patrick-arns.de>"
]
},
"license": "MIT",
"platform": "Javascript/Node.js",
"mode": "daemon",
"icon": "netatmo.png",
"enabled": false,
"messagebox": true,
"extIcon": "https://raw.githubusercontent.com/PArns/ioBroker.netatmo/master/admin/netatmo.png",
"keywords": [
"netatmo"
"protectedNative": [
"secret",
"id",
"username",
"password"
],
"readme": "https://github.com/PArns/ioBroker.netatmo/blob/master/README.md",
"loglevel": "info",
"type": "weather",
"authors": [
"Patrick Arns <iobroker@patrick-arns.de>"
]
},
"native": {
"netatmoWeather": true,
"netatmoWelcome": false,
"netatmoCoach": false,
"username": "",
"password": "",
"check_interval": 5,
"cleanup_interval": 60,
"event_time": 12,
"unknown_person_time": 24,
"location_elevation": 0,
"id": "",
"secret": ""
},
"objects": [
]
}
"native": {
"netatmoWeather": true,
"netatmoWelcome": false,
"netatmoCoach": false,
"username": "",
"password": "",
"check_interval": 5,
"cleanup_interval": 60,
"event_time": 12,
"unknown_person_time": 24,
"location_elevation": 0,
"id": "",
"secret": ""
},
"objects": []
}

@@ -1,74 +0,80 @@

/* jshint -W097 */// jshint strict:false
/*jslint node: true */
"use strict";
/* jshint -W097 */
/* jshint strict: false */
/* jslint node: true */
'use strict';
var utils = require('@iobroker/adapter-core');
var adapter = utils.Adapter('netatmo');
const adapterName = require('./package.json').name.split('.').pop();
const utils = require('@iobroker/adapter-core');
var netatmo = require('./netatmoLib');
var api = null;
const netatmo = require('./lib/netatmoLib');
let api = null;
var NetatmoCoach = require("./netatmoCoach");
var coach = null;
const NetatmoCoach = require('./lib/netatmoCoach');
let coach = null;
var NetatmoStation = require("./netatmoStation");
var station = null;
const NetatmoStation = require('./lib/netatmoStation');
let station = null;
var NetatmoWelcome = require("./netatmoWelcome");
var welcome = null;
const NetatmoWelcome = require('./lib/netatmoWelcome');
let welcome = null;
var _deviceUpdateTimer;
var _welcomeUpdateTimer;
let _deviceUpdateTimer;
let _welcomeUpdateTimer;
String.prototype.replaceAll = function (search, replacement) {
var target = this;
const target = this;
return target.replace(new RegExp(search, 'g'), replacement);
};
adapter.on('message', function (obj) {
let adapter;
adapter.log.info(JSON.stringify(obj));
function startAdapter(options) {
options = options || {};
Object.assign(options, {
name: adapterName, // adapter name
});
if (obj.command === "send") {
obj.command = obj.message;
obj.message = null;
}
adapter = new utils.Adapter(options);
adapter.on('message', obj => {
if (obj.command === 'send') {
obj.command = obj.message;
obj.message = null;
}
if (obj) {
switch (obj.command) {
case 'setAway':
if (welcome) {
welcome.setAway(obj.message);
}
if (obj) {
switch (obj.command) {
case 'setAway':
welcome && welcome.setAway(obj.message);
if (obj.callback)
adapter.sendTo(obj.from, obj.command, {}, obj.callback);
obj.callback && adapter.sendTo(obj.from, obj.command, {}, obj.callback);
break;
default:
adapter.log.warn("Unknown command: " + obj.command);
break;
break;
default:
adapter.log.warn('Unknown command: ' + obj.command);
break;
}
}
}
return true;
});
return true;
});
adapter.on('unload', function (callback) {
try {
if (welcome)
welcome.finalize();
adapter.on('unload', function (callback) {
try {
welcome && welcome.finalize();
adapter.log.info('cleaned everything up...');
callback();
} catch (e) {
callback();
}
});
adapter.log.info('cleaned everything up...');
callback();
} catch (e) {
callback();
}
});
adapter.on('ready', function () {
adapter.on('ready', main);
}
function main() {
if (adapter.config.username && adapter.config.password) {
var scope = "";
var id = "574ddd152baa3cf9598b46cd";
var secret = "6e3UcBKp005k9N0tpwp69fGYECqOpuhtEE9sWJW";
let scope = '';
let id = '574ddd152baa3cf9598b46cd';
let secret = '6e3UcBKp005k9N0tpwp69fGYECqOpuhtEE9sWJW';

@@ -79,24 +85,20 @@ // Backward compatibility begin ...

if (!(adapter.config.netatmoCoach || adapter.config.netatmoWeather || adapter.config.netatmoWelcome)) {
adapter.log.info("No product was choosen, using Weatherstation as default!");
adapter.log.info('No product was chosen, using Weatherstation as default!');
adapter.config.netatmoWeather = true;
}
if (!adapter.config.check_interval)
adapter.config.check_interval = 10;
adapter.config.check_interval = adapter.config.check_interval || 10;
if (!adapter.config.cleanup_interval)
adapter.config.cleanup_interval = 60;
adapter.config.cleanup_interval = adapter.config.cleanup_interval || 60;
if (!adapter.config.unknown_person_time)
adapter.config.unknown_person_time = 24;
adapter.config.unknown_person_time = adapter.config.unknown_person_time || 24;
if (!adapter.config.location_elevation)
adapter.config.location_elevation = 0;
adapter.config.location_elevation = adapter.config.location_elevation || 0;
if (adapter.config.netatmoWeather) {
scope += " read_station";
scope += ' read_station';
}
if (adapter.config.netatmoCoach) {
scope += " read_homecoach";
scope += ' read_homecoach';
}

@@ -108,3 +110,3 @@

if (adapter.config.netatmoWelcome) {
scope += " read_camera read_presence";
scope += ' read_camera read_presence';

@@ -115,3 +117,3 @@ if (adapter.config.id && adapter.config.secret) {

scope += " access_camera access_presence write_camera"
scope += ' access_camera access_presence write_camera'
}

@@ -122,8 +124,8 @@ }

var auth = {
"client_id": id,
"client_secret": secret,
"scope": scope,
"username": adapter.config.username,
"password": adapter.config.password
const auth = {
'client_id': id,
'client_secret': secret,
'scope': scope,
'username': adapter.config.username,
'password': adapter.config.password
};

@@ -140,5 +142,4 @@

_deviceUpdateTimer = setInterval(function () {
coach.requestUpdateCoachStation();
}, adapter.config.check_interval * 60 * 1000);
_deviceUpdateTimer = setInterval(() =>
coach.requestUpdateCoachStation(), adapter.config.check_interval * 60 * 1000);
}

@@ -151,5 +152,4 @@

_deviceUpdateTimer = setInterval(function () {
station.requestUpdateWeatherStation();
}, adapter.config.check_interval * 60 * 1000);
_deviceUpdateTimer = setInterval(() =>
station.requestUpdateWeatherStation(), adapter.config.check_interval * 60 * 1000);
}

@@ -162,9 +162,17 @@

_welcomeUpdateTimer = setInterval(function () {
welcome.requestUpdateIndoorCamera();
}, adapter.config.check_interval * 2 * 60 * 1000);
_welcomeUpdateTimer = setInterval(() =>
welcome.requestUpdateIndoorCamera(), adapter.config.check_interval * 2 * 60 * 1000);
}
} else {
adapter.log.error('Please add username, password and choose at least one product within the adapter settings!');
}
}
} else
adapter.log.error("Please add username, password and choose at least one product within the adapter settings!");
});
// If started as allInOne mode => return function to create instance
if (module && module.parent) {
module.exports = startAdapter;
} else {
// or start the instance directly
startAdapter();
}
{
"name": "iobroker.netatmo",
"version": "1.3.3",
"version": "1.4.0",
"description": "ioBroker netatmo Adapter",

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

"dependencies": {
"@iobroker/adapter-core": "^1.0.3",
"@iobroker/adapter-core": "^2.5.0",
"dewpoint": "^1.0.0",
"moment": "^2.18.1",
"request": "^2.81.0",
"moment": "^2.29.1",
"request": "^2.88.2",
"socket.io-client": "^2.3.0"
},
"devDependencies": {
"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"
"@alcalzone/release-script": "^2.0.0",
"mocha": "^9.0.1",
"chai": "^4.3.4"
},

@@ -59,4 +51,4 @@ "bugs": {

"scripts": {
"test": "node node_modules/mocha/bin/mocha --exit"
"release": "release-script"
}
}

@@ -32,3 +32,10 @@ ![Logo](admin/netatmo.png)

<!--
Placeholder for the next version (at the beginning of the line):
### __WORK IN PROGRESS__
-->
## Changelog
### 1.4.0 (2021-06-24)
* (bluefox) Added the support of admin5
* (bluefox) Removed warnings about the type of states

@@ -35,0 +42,0 @@ ### 1.3.3

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