New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-knx-ultimate

Package Overview
Dependencies
Maintainers
0
Versions
461
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-knx-ultimate - npm Package Compare versions

Comparing version

to
3.0.0

30

nodes/utils/hueEngine.js

@@ -5,4 +5,6 @@ /* eslint-disable max-len */

const http = require("./http");
const pleaseWait = t => new Promise((resolve, reject) => setTimeout(resolve, t))
class classHUE extends EventEmitter {
constructor(_hueBridgeIP, _username, _clientkey, _bridgeid, _sysLogger) {

@@ -17,6 +19,5 @@ super();

// eslint-disable-next-line max-len
this.timerwriteQueueAdd = setTimeout(this.handleQueue, 10000); // First start. Allow the KNX to connect
setTimeout(this.handleQueue, 10000); // First start. Allow the KNX to connect
this.sysLogger = _sysLogger;
this.timerCheckConnected = undefined;
this.timerCheckConnected = null;
}

@@ -80,3 +81,3 @@

// Check wether the hue bridge is connected or not
if (this.timerCheckConnected !== undefined) clearInterval(this.timerCheckConnected);
if (this.timerCheckConnected !== null) clearInterval(this.timerCheckConnected);
this.timerCheckConnected = setInterval(() => {

@@ -126,4 +127,5 @@ this.writeHueQueueAdd(null, null, "Ping");

} catch (error) {
if (this.sysLogger !== undefined && this.sysLogger !== null)
this.sysLogger.info(`KNXUltimatehueEngine: classHUE: handleQueue: setLight light: ${error.message}`);
if (this.sysLogger !== undefined && this.sysLogger !== null) {
this.sysLogger.info(`KNXUltimatehueEngine: classHUE: handleQueue: setLight light: ${error.message}. CHECK WETHER THE DEVICE IS POWERED ON`);
}
}

@@ -167,3 +169,3 @@ break;

if (this.sysLogger !== undefined && this.sysLogger !== null) this.sysLogger.error(`KNXUltimatehueEngine: classHUE: handleQueue: Ping: ${error.message}`);
if (this.timerCheckConnected !== undefined) clearInterval(this.timerCheckConnected);
if (this.timerCheckConnected !== null) clearInterval(this.timerCheckConnected);
this.commandQueue.length = [];

@@ -178,4 +180,4 @@ this.emit("disconnected");

// The Hue bridge allows about 10 telegram per second, so i need to make a queue manager
//await new Promise(resolve => setTimeout(resolve, 2000));
this.timerwriteQueueAdd = setTimeout(this.handleQueue, 200);
await pleaseWait(150); // Waits
if (this.closePushEventStream === false) this.handleQueue();
};

@@ -189,6 +191,6 @@

/**
* Clears all items fo _lightID from the HUE sending queue. Useful to clear unwanted dimming commands
* @param {string} _lightID HUE Light ID
* @returns {}
*/
* Clears all items fo _lightID from the HUE sending queue. Useful to clear unwanted dimming commands
* @param {string} _lightID HUE Light ID
* @returns {}
*/
deleteHueQueue = async (_lightID) => {

@@ -204,3 +206,3 @@ // Add the new item

if (this.timerReconnect !== undefined) clearInterval(this.timerReconnect);
this.closePushEventStream = true;
this.closePushEventStream = true; // Signal to exit all loops
try {

@@ -207,0 +209,0 @@ if (this.es !== null && this.es !== undefined) this.es.close();

@@ -6,3 +6,3 @@ {

},
"version": "3.0.0-beta3",
"version": "3.0.0",
"description": "Control your KNX intallation via Node-Red! A bunch of KNX nodes, with integrated Philips HUE control and ETS group address importer. Easy to use and highly configurable.",

@@ -9,0 +9,0 @@ "dependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display