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

node-red-contrib-boolean-logic-ultimate

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-boolean-logic-ultimate - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

28

boolean-logic-ultimate/SumUltimate.js

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

node.math = config.math === undefined ? "sum" : config.math;
node.subtractstartfrom = config.subtractstartfrom === undefined ? "" : config.subtractstartfrom;
node.topics = [];

@@ -54,4 +55,7 @@

if (!isNaN(ret) && isFinite(ret)) {
if (node.topics.find(a => a.id === msg.topic.toString()) === undefined) {
let oFound = node.topics.find(a => a.id === msg.topic.toString());
if (oFound === undefined) {
node.topics.push({ id: msg.topic.toString(), val: ret });
} else {
oFound.val = ret;
}

@@ -82,8 +86,20 @@

} else if (node.math === "subtract") {
let risultato = node.topics[0].val;
let risultato = 0;
if (node.subtractstartfrom !== "") {
try {
risultato = node.topics.find(m => m.id === node.subtractstartfrom).val;
} catch (error) {
setNodeStatus({ fill: "grey", shape: "ring", text: "Waiting for " + node.subtractstartfrom });
return;
}
} else {
setNodeStatus({ fill: "red", shape: "ring", text: "Please specify the topic form subtract to." });
return;
}
quantita = 1;
for (let index = 1; index < node.topics.length; index++) {
risultato -= node.topics[index].val;
++quantita;
for (let index = 0; index < node.topics.length; index++) {
if (node.topics[index].id !== node.subtractstartfrom) {
risultato -= node.topics[index].val;
++quantita;
}
}

@@ -90,0 +106,0 @@

@@ -7,2 +7,6 @@ # node-red-contrib-boolean-logic-ultimate

<p>
<b>Version 1.1.6</b> April 2024<br/>
- Math node: in SUBTRACT mode, now you must set a msg.topic to start subtracting from.</br>
</p>
<p>
<b>Version 1.1.5</b> April 2024<br/>

@@ -9,0 +13,0 @@ - Math node: fixed an issue with the "subtract" operator. See contestual help in the node-red help tab.</br>

{
"name": "node-red-contrib-boolean-logic-ultimate",
"version": "1.1.5",
"version": "1.1.6",
"description": "A set of Node-RED enhanced boolean logic and utility nodes, flow interruption, blinker, invert, filter, toggle etc.., with persistent values after reboot. Compatible also with Homeassistant values.",

@@ -5,0 +5,0 @@ "author": "Supergiovane (https://github.com/Supergiovane)",

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