iobroker.netatmo
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -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" |
{ | ||
"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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
193497
3904
3
5
11
15
+ Added@iobroker/adapter-core@1.0.3(transitive)
+ Added@types/component-emitter@1.2.14(transitive)
+ Added@types/iobroker@1.4.13(transitive)
+ Added@types/node@22.10.8(transitive)
+ Addedbase64-arraybuffer@0.1.4(transitive)
+ Addedcomponent-emitter@1.3.1(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addedengine.io-client@4.1.4(transitive)
+ Addedengine.io-parser@4.0.3(transitive)
+ Addedms@2.1.3(transitive)
+ Addedparseqs@0.0.6(transitive)
+ Addedparseuri@0.0.6(transitive)
+ Addedsocket.io-client@3.1.3(transitive)
+ Addedsocket.io-parser@4.0.5(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addedws@7.4.6(transitive)
- Removedafter@0.8.2(transitive)
- Removedarraybuffer.slice@0.0.6(transitive)
- Removedbase64-arraybuffer@0.1.5(transitive)
- Removedbetter-assert@1.0.2(transitive)
- Removedblob@0.0.4(transitive)
- Removedcallsite@1.0.0(transitive)
- Removedcomponent-bind@1.0.0(transitive)
- Removedcomponent-emitter@1.1.21.2.1(transitive)
- Removedcomponent-inherit@0.0.3(transitive)
- Removeddebug@2.2.02.3.3(transitive)
- Removedengine.io-client@1.8.6(transitive)
- Removedengine.io-parser@1.3.2(transitive)
- Removedhas-binary@0.1.7(transitive)
- Removedindexof@0.0.1(transitive)
- Removedisarray@0.0.1(transitive)
- Removedjson3@3.3.2(transitive)
- Removedms@0.7.10.7.2(transitive)
- Removedobject-component@0.0.3(transitive)
- Removedoptions@0.0.6(transitive)
- Removedparsejson@0.0.3(transitive)
- Removedparseqs@0.0.5(transitive)
- Removedparseuri@0.0.5(transitive)
- Removedsocket.io-client@1.7.4(transitive)
- Removedsocket.io-parser@2.3.1(transitive)
- Removedto-array@0.1.4(transitive)
- Removedultron@1.0.2(transitive)
- Removedws@1.1.5(transitive)
- Removedwtf-8@1.0.0(transitive)
Updatedsocket.io-client@^3.0.1