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

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.0.5 to 0.0.6

lib/discovery.js

5

io-package.json
{
"common": {
"name": "wifilight",
"version": "0.0.5",
"version": "0.0.6",
"title": "WiFi Light",

@@ -17,3 +17,4 @@ "desc": {

"loglevel": "info",
"type": "hardware"
"type": "hardware",
"messagebox": true
},

@@ -20,0 +21,0 @@ "native": {

3

package.json
{
"name": "iobroker.wifilight",
"version": "0.0.5",
"version": "0.0.6",
"description": "WiFi Light Adapter",

@@ -28,2 +28,3 @@ "author": {

"dependencies": {
"netmask": "^1.0.6"
},

@@ -30,0 +31,0 @@ "devDependencies": {},

@@ -7,2 +7,3 @@ "use strict";

net = require('net'),
discovery = require(__dirname + '/lib/discovery'),
colors = require(__dirname + '/lib/colors');

@@ -43,4 +44,5 @@

},
message: onMessage,
ready: function () {
adapter.log.debug = console.log;
//adapter.log.debug = console.log;
devices.init(adapter, function(err) {

@@ -52,2 +54,29 @@ main();

function onMessage (obj) {
if (!obj) return;
switch (obj.command) {
case 'discovery':
discovery.scanForDevices(
function(entry) {
return !adapter.config.devices.some(function(e,i) {
return e.ip == entry.ip;
});
},
function (result) {
if (obj.callback) {
adapter.sendTo (obj.from, obj.command, JSON.stringify(result), obj.callback);
}
}
);
return true;
default:
adapter.log.warn("Unknown command: " + obj.command);
break;
}
if (obj.callback) adapter.sendTo (obj.from, obj.command, obj.message, obj.callback);
return true;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

@@ -67,3 +96,2 @@

white: { n: 'w', val: 0, common: { min: 0, max: 255 }},
//progNo: { n: 'progNo', val: 38, common: { min: 35, max: 56, desc: '36..56', states: {"0": "DRY", "1": "RAIN" } }, native: { VALUE_LIST: [ "DRY","RAIN" ] }},
progNo: { n: 'progNo', val: 38, common: { min: 35, max: 56, desc: '37..56, 97=none' }},

@@ -80,10 +108,2 @@ progOn: { n: 'progOn', val: false, common: { min: false, max: true }},

//function getState(id, state) {
// //var s = id.replace(/\w+$/, state);
// //var s = id.replace(/\w+$/, '');
// var o = devices.get(id);
// if (o === undefined) return undefined;
// return o.val || 0;
//}
function stateChange(id, state) {

@@ -149,8 +169,2 @@ var ar = id.split('.');

case usedStateNames.command.n:
//var v = state.val.replace(/^on$|red|green|blue|transition|bri|off/g, function(match) { return { on:'on:1', red:'r', green:'g', blue:'b', transition:'x', bri:'l', off:'on:0'}[match] });
//v = v.replace(/\s|\"|;$|,$/g, '').replace(/=/g, ':').replace(/;/g, ',').replace(/true/g, 1).replace(/(r|g|b|x|l|sat|on|ct)/g, '"$1"').replace(/^\{?(.*?)\}?$/, '{$1}');
//var v = state.val.replace(/^on$|red|green|blue|transition|bri|off/g, function(match) { return { on:'on:1', red:'r', green:'g', blue:'b', white: 'w', transition:'x', bri:'l', off:'on:0'}[match] });
//v = v.replace(/\s|\"|;$|,$/g, '').replace(/=/g, ':').replace(/;/g, ',').replace(/true/g, 1).replace(/(r|g|b|w|x|l|sat|on|ct)/g, '"$1"').replace(/^\{?(.*?)\}?$/, '{$1}');
var v = state.val.replace(/^on$|red|green|blue|transition|bri|off/g, function(match) { return { of:'off:1', on:'on:1', red:'r', green:'g', blue:'b', white: 'w', transition:'x', bri:'l', off:'on:0'}[match] });

@@ -177,3 +191,2 @@ v = v.replace(/\s|\"|;$|,$/g, '').replace(/=/g, ':').replace(/;/g, ',').replace(/true/g, 1).replace(/(r|g|b|w|x|l|sat|of|on|ct)/g, '"$1"').replace(/^\{?(.*?)\}?$/, '{$1}');

}
//if (colors.r!==undefined || colors.g!==undefined || colors.b!==undefined || colors.sat!==undefined) {
if (colors.r!==undefined || colors.g!==undefined || colors.b!==undefined || colors.w!==undefined || colors.sat!==undefined) {

@@ -309,4 +322,2 @@ device.fade(channel, o, transitionTime);

self.destroyClient();
//self.client.destroy();
//self.client = null;
});

@@ -313,0 +324,0 @@

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