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

node-red-contrib-deconz

Package Overview
Dependencies
Maintainers
1
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-deconz - npm Package Compare versions

Comparing version 0.10.5 to 0.10.6

47

nodes/in.js

@@ -42,2 +42,3 @@ module.exports = function(RED) {

node.status({}); //clean
node.getState(deviceMeta);
}, 1500); //update status with the same delay

@@ -61,6 +62,7 @@ }

sendState(device) {
getState(device) {
var node = this;
if (device.state === undefined) {
return;
// console.log("CODE: #66");

@@ -89,12 +91,17 @@ // console.log(device);

}
if (node.oldState === undefined && device.state[node.config.state]) { node.oldState = device.state[node.config.state]; }
if (node.prevUpdateTime === undefined && device.state['lastupdated']) { node.prevUpdateTime = device.state['lastupdated']; }
return(device)
}
};
//outputs
if ( node.config.state in device.state && node.config.output == 'onchange' && device.state[node.config.state] == node.oldState ) {
return;
}
if ( node.config.state in device.state && node.config.output == 'onupdate' && device.state['lastupdated'] == node.prevUpdateTime ) {
return;
}
node.oldState = device.state[node.config.state];
node.prevUpdateTime = device.state['lastupdated'];
sendState(device) {
var node = this;
device = node.getState(device);
if(!device) { return; }
//outputs
if ( !(node.config.state in device.state && node.config.output == 'onchange' && device.state[node.config.state] == node.oldState) &&
!(node.config.state in device.state && node.config.output == 'onupdate' && device.state['lastupdated'] == node.prevUpdateTime ))
{
node.send([

@@ -108,2 +115,4 @@ {

}
node.oldState = device.state[node.config.state];
node.prevUpdateTime = device.state['lastupdated'];
};

@@ -152,11 +161,11 @@

//https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Xiaomi-WXKG01LM
// Event Button Action
// 1000 One initial press
// 1001 One single hold
// 1002 One single short release
// 1003 One single hold release
// 1004 One double short press
// 1005 One triple short press
// 1006 One quad short press
// 1010 One five+ short press
// Event Button Action
// 1000 One initial press
// 1001 One single hold
// 1002 One single short release
// 1003 One single hold release
// 1004 One double short press
// 1005 One triple short press
// 1006 One quad short press
// 1010 One five+ short press
if ([1002,2002,3002,4002,5002].indexOf(state['buttonevent']) >= 0) characteristic.ProgrammableSwitchEvent = 0;

@@ -163,0 +172,0 @@ else if ([1004,2004,3004,4004,5004].indexOf(state['buttonevent']) >= 0) characteristic.ProgrammableSwitchEvent = 1;

@@ -41,3 +41,3 @@ {

},
"version": "0.10.5"
"version": "0.10.6"
}

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