Socket
Socket
Sign inDemoInstall

iobroker.wifilight

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iobroker.wifilight - npm Package Compare versions

Comparing version 0.1.1 to 0.1.3

12

io-package.json
{
"common": {
"name": "wifilight",
"version": "0.1.1",
"version": "0.1.3",
"news": {
"0.1.3": {
"en": "Normalize devices for devices added by discovery",
"de": "Daten-Normalisierung der von Discovery hinzugefügten Geräte"
},
"0.1.2": {
"en": "possible exception when deleting unused devices",
"de": "Möglicher Ausnahmefehler beim Löschen unbenutzter Geräte",
}
},
"title": "WiFi Light",

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

2

package.json
{
"name": "iobroker.wifilight",
"version": "0.1.1",
"version": "0.1.3",
"description": "WiFi Light Adapter",

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

@@ -894,3 +894,3 @@ "use strict";

});
toDelete.forEachCallback(function(id, next) {
toDelete.forEachCallback(function(next, id) {
dcs.del(id, next);

@@ -904,15 +904,30 @@ },

function normalizeConfigDevice(dev) {
dev.pollIntervall = parseInt(dev.pollIntervall) | 0;
if (dev.pollIntervall && dev.pollIntervall < 5) dev.pollIntervall = 5;
dev.port = parseInt(dev.port) || 5577;
function normalizeConfig (config) {
var changed = false;
config.devices.forEach(function (d, i) {
var old = Object.assign({}, d);
var dev = cmds.knownDeviceNames[d.name];
d.pollIntervall = parseInt(dev.pollIntervall) | 0;
if (d.pollIntervall && d.pollIntervall < 5) d.pollIntervall = 5;
d.port = parseInt(d.port) || 5577;
if (d.type === undefined) d.type = dev ? dev.type : '';
if (d.port === undefined) d.port = dev && dev.port ? dev.port : 5577;
if (d.pollIntervall === undefined) d.pollIntervall = 30;
Object.keys(d).forEach(function(key) {
changed = changed || d[key] !== old[key];
});
});
if (changed) {
soef.changeAdapterConfig (adapter, function(conf) {
conf.devices = config.devices;
});
}
}
//var capn = require(__dirname + '/capn');
function main() {
//var ln = capn.line;
if (!adapter.config.devices) return;

@@ -922,5 +937,4 @@ checkDeletedDevices(function(err) {

});
normalizeConfig(adapter.config);
for (var i=0; i<adapter.config.devices.length; i++) {
normalizeConfigDevice(adapter.config.devices[i]);
if (adapter.config.devices[i].type === 'MiLight') {

@@ -927,0 +941,0 @@ for (var zone=0; zone<=4; zone++) {

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