Переглянути джерело

Fixed crappy intert node

master
Massimo 5 роки тому
джерело
коміт
5bf0346d1b
5 змінених файлів з 16 додано та 10 видалено
  1. +4
    -0
      CHANGELOG.md
  2. +3
    -1
      boolean-logic-ultimate/BooleanLogicUltimate.html
  3. +3
    -3
      boolean-logic-ultimate/InvertUltimate.html
  4. +5
    -5
      boolean-logic-ultimate/InvertUltimate.js
  5. +1
    -1
      package.json

+ 4
- 0
CHANGELOG.md Переглянути файл

@@ -1,5 +1,9 @@
# node-red-contrib-boolean-logic-ultimate
<p>
<b>Version 0.0.6</b><br/>
- Fixed crappy "Invert" node.<br/>
</p>
<p>
<b>Version 0.0.5</b><br/>
- Bypass persistency if node-red user hasn't permissions to write to the filesystem.<br/>
</p>

+ 3
- 1
boolean-logic-ultimate/BooleanLogicUltimate.html Переглянути файл

@@ -47,7 +47,7 @@
icon: "serial.png",
label:
function() {
var label = "Logic" + " [" + this.inputCount + "]";
var label = "Logic" + (this.filtertrue=="both" ? "" : " filtered" ) + " [" + this.inputCount + "]";
if( this.name !== undefined && this.name.length > 0 ) {
label = label + " (" + this.name + ")";
}
@@ -96,6 +96,7 @@
- Output "AND": true or false<br/>
- Output "OR": true or false<br/>
- Output "XOR": true or false<br/>
<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/>
@@ -107,6 +108,7 @@
<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>
<b>filtered</b>: shown on label, means that the node will pass out only <code>true</code> values (Output only 'true' results). <br/>
<br/><br/>
<b>Remember latest input values after reboot</b><br />
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/>

+ 3
- 3
boolean-logic-ultimate/InvertUltimate.html Переглянути файл

@@ -1,10 +1,10 @@
<script type="text/javascript">
RED.nodes.registerType('InvertUltimate',{
category: 'boolean logic ultimate',
category: 'boolean logic',
color: '#ff8080',
defaults: {
name: {
value: "InvertUltimate"
value: "Invert"
}
},
inputs:1,
@@ -12,7 +12,7 @@
icon: "serial.png",
label:
function() {
return this.name||"InvertUltimate";
return this.name||"Invert";
},
paletteLabel: function() {
return "InvertUltimate";

+ 5
- 5
boolean-logic-ultimate/InvertUltimate.js Переглянути файл

@@ -3,19 +3,19 @@ module.exports = function(RED) {
RED.nodes.createNode(this,config);
this.config = config;
var node = this;
node.status( {fill: "grey" ,shape: "dot" ,text: "waiting"});
this.on('input', function(msg) {
var topic = msg.topic;
var topic = msg.topic || "";
var payload = msg.payload;
if (topic !== undefined && payload !== undefined) {
node.status( {fill: "green" ,shape: "dot" ,text: !ToBoolean(payload)});
return({ topic: topic, payload: !ToBoolean(payload) });
node.send({ topic: topic, payload: !ToBoolean(payload) });
return;
}
});
node.status( {fill: "grey" ,shape: "dot" ,text: payload});

function ToBoolean( value ) {
var res = false;

+ 1
- 1
package.json Переглянути файл

@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-boolean-logic-ultimate",
"version": "0.0.5",
"version": "0.0.6",
"description": "A set of Node-RED enhanced boolean logic, with persisten values after reboot and more",
"author": "Supergiovane (https://github.com/Supergiovane)",
"dependencies": {

Завантаження…
Відмінити
Зберегти