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.0.10 to 1.0.11

img/logo.png

7

CHANGELOG.md
# node-red-contrib-boolean-logic-ultimate
[![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square)](https://www.paypal.me/techtoday)
<a href="http://eepurl.com/gJm095" target="_blank">Subscribe to my channel.</a> Only news about my nodes, no spam, no ads. I'm a github developer, not a merchant.
<p>
<b>Version 1.0.11</b><br/>
- Enhanced help.</br>
</p>
<p>
<b>Version 1.0.10</b><br/>

@@ -5,0 +12,0 @@ - Fix a possible issue in the "Interrupt Flow", if the trigger topic contains special characters.</br>

2

package.json
{
"name": "node-red-contrib-boolean-logic-ultimate",
"version": "1.0.10",
"version": "1.0.11",
"description": "A set of Node-RED enhanced boolean logic, with persisten values after reboot and more",

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

# node-red-contrib-boolean-logic-ultimate
![Sample Node](img/logo.png)
Set of enhanced logic nodes for your flows.
[![NPM version][npm-version-image]][npm-url]

@@ -10,4 +14,17 @@ [![NPM downloads per month][npm-downloads-month-image]][npm-url]

## DESCRIPTION
[![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square)](https://www.paypal.me/techtoday)
<a href="http://eepurl.com/gJm095" target="_blank">Subscribe to my channel.</a> Only news about my nodes, no spam, no ads. I'm a github developer, not a merchant.
> Wellcome! First of all thank you for your interest in my nodes. This is a set of logic nodes, to overcome the simplicity of the default node-red boolean logic nodes.
Hope you enjoy that and if you're in trouble, please ask!
## CHANGELOG
* See <a href="https://github.com/Supergiovane/node-red-contrib-boolean-logic-ultimate/blob/master/CHANGELOG.md">here the changelog</a>
# BOOLEAN LOGIC
The node performs Boolean logic on the incoming payloads.<br/>
The node expects a fixed number of topics (configured in the settings) on which it will operate. It will only output a value
when it has seen the expected number of topics. If it ever sees more than the configured number of topics it will log a message then reset its state and start over.<br/>
The node performs 3 checks (<b>AND,OR,XOR</b>) on the incoming boolean payloads and outputs the result at the same time, as follow:<br/>

@@ -18,83 +35,46 @@ - Output "AND": true or false<br/>

The node can have a persistent input: the input values are retained after a node-red reboot. That means, that if you reboot your node-red, you don't need to wait all inputs to arrive and initialize the node, before the node can output a payload.
The node can have a persistent input: the input values are retained after a node-red reboot. That means, that if you reboot your node-red, you don't need to wait all inputs to arrive and initialize the node, before the node can output a payload.<br/>
You can also set the default values of the topic inputs.
## ADDITIONAL FUNCTIONS
* Filter ouput results (outputs only true or trye/false)
* Trigger mode selection (Can output a payload only by single input's topic trigger and after evaluation ot other inputs, or can oputput a payload by change of every input)
## CHANGELOG
* See <a href="https://github.com/Supergiovane/node-red-contrib-boolean-logic-ultimate/blob/master/CHANGELOG.md">here the changelog</a>
## CONFIGURATION
<p>
The node expects a fixed number of topics (configured in the settings) on which it will operate. It will only output a value
when it has seen the expected number of topics. If it ever sees more than the configured number of topics it will log a message then reset its state and start over.<br/>
Changing the topic is usually only needed when chaining multiple boolean nodes after each other becuse the topics will then all be the same when delivered to the nodes further down the chain.<br/>
<br/>
***Number of different topics to evaluate***
**Number of different topics to evaluate**
Set the number of different topics to be evaluated. The node will output a message to the flow, after this number of different topics arrives.<br/>
<b> Remember: each input topic must be different. For example, if you set this field to 3, the node expects 3 different topics.</b><br/>
*Remember: each input topic must be different. For example, if you set this field to 3, the node expects 3 different topics.*
***Filter output result***
<ol>
<li>Output both 'true' and 'false' results: Standard behaviour, the node will output <b>true</b> and <b>false</b> whenever it receives an input and calculate the boolean logics as output.</li>
<li>Output only 'true' results: whenever the node receives an input, it outputs a payload <b>true</b> only if the result of the logic is true. <b>False</b> results are filtered out.</li>
</ol>
<br/>
**Filter output result**
<b>Trigger mode</b><br />
The node can acts ad a standard boolean logic or as single topic triggered boolean logic.<br/>
As single topic triggered boolean logic, the node will evaluate the inputs (and thus will output a payload) only if a specified topic input arrives.<br/>
In a coding perspectives, it acts as follows:<br/>
<code>
if (msg.topic == specified topic)<br/>
{<br/>
If (all other inputs are true) -> outputs true otherwise false<br/>
}<br/>
</code>
<ol>
<li>All topics: standard behaviour, the node will output <b>true</b> and <b>false</b> by evaluating all inputs. Each input change will trigger the node output.</li>
<li>Single topic + eval other inputs: <u>only whenever the node receives a msg input with the <b>specified topic</b> (having payload = true)</u>, it starts the evaluation of all other inputs as well and outputs the evaluated payload. If the node receives a msg input other than the <b>specified topic</b>), it only retains it's value for the boolean evaluation.</li>
</ol>
- Output both 'true' and 'false' results: Standard behaviour, the node will output <b>true</b> and <b>false</b> whenever it receives an input and calculate the boolean logics as output.
- Output only 'true' results: whenever the node receives an input, it outputs a payload <b>true</b> only if the result of the logic is true. <b>False</b> results are filtered out.
<b>If input states are undefined</b><br />
Every time you create a node or modify the node, all inputs are set to undefined. This means that the node will wait the arrive of all topics (for example 3 topics, if you've selected 3 topics in the option), before it can output a payload. This can be a problem if your logic must be operative as soon as you deploy the flow. To overcome this problem, you can "initialize" all the undefined inputs with True or False.
<ol>
<li>Leave undefined: Standard behaviour, the node will wait all the "undefined" topics to arrive, then starts a flow with the result.</li>
<li>True or False: The node is immediately operative, by force the initialization of the "undefined" inputs with "true" or "false".</li>
</ol>
<br/>
**Trigger mode**
- All topics: standard behaviour, the node will evaluate each input topic and ouputs the values. At each input change, it will output a msg on the flow.
- Single topic + eval other inputs: the node evaluates all the input topics, but only whenever it receives a msg input with the **specified topic** (having payload **true**), it outputs a msg to the flow.
<br/><br/>
**If input states are undefined**
<b>Remember latest input values after reboot</b><br />
Every time you create a node or modify the node, all inputs are set to undefined. This means that the node will wait the arrive of all topics (for example 3 topics, if you've selected 3 topics in the option), before it can output a payload. This can be a problem if your logic must be operative as soon as you deploy the flow. To overcome this problem, you can "initialize" all the undefined inputs with True or False.
- Leave undefined: Standard behaviour, the node will wait all the "undefined" topics to arrive, then starts a flow with the result.
- True or False: The node is immediately operative, by force the initialization of the "undefined" inputs with "true" or "false".
**Remember latest input values after reboot**
If checked, the input values are retained after a node-red reboot. That means, that if you reboot your node-red, you don't need to wait all inputs to arrive and initialize the node, before the node can output a payload.<br/>
Every time you modify the node's config, <b>the retained values are cleared</b>.<br/>
<br/>
All incoming msg.payloads are converted into a boolean value according to the following rules (this applies to all boolean logic nodes):
<ol>
<li>Boolean values are taken as-is.</li>
<li>For numbers, 0 evaluates to false, all other numbers evaluates to true.</li>
<li>Strings are converted to numbers if they match the format of a decimal value, then the same rule as for numbers are applied. If it does not match, it evaluates to false. Also, the string "true" evaluates to true.</li>
</ol>
<br>
The XOR operation operates in a one, and only one mode, i.e. (A ^ B) ^ C ... ^ n
</p>
<p>
# OTHER USEFUL NODES
**Interrupt Flow**
# INTERRUPT FLOWS ULTIMATE
Whenever this node receives a payload = false from a specific topic, it stops output messages to the flow. As soon it receives payload = true from this topic, the output messages start to flow out again.
**Invert Ultimate**
# INVERT ULTIMATE
Outputs the inverted input. For example true -> false
**Filter Ultimate**
# FILTER ULTIMATE

@@ -101,0 +81,0 @@ This node has 2 outputs.<br />

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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