node-red-contrib-boolean-logic-ultimate 1.1.11 → 1.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
 
4
4
  # CHANGELOG
5
5
 
6
+ <p>
7
+ <b>Version 1.1.12</b> Mai 2024<br/>
8
+ - FIX: fixed the empty JSON for old injectUltimate nodes.</br>
9
+ </p>
6
10
  <p>
7
11
  <b>Version 1.1.11</b> Mai 2024<br/>
8
12
  - NEW: inject node now can inject a JSON as well.</br>
@@ -56,13 +56,14 @@
56
56
  },
57
57
  oneditprepare: function () {
58
58
  var node = this;
59
+
60
+ if (node.outputJSON === undefined || node.outputJSON === '') node.outputJSON = '{ \n\t"payload":"hello",\n\t"topic":"1"\n}';
59
61
  node.editor = RED.editor.createEditor({
60
62
  id: 'node-input-editoroutputJSON',
61
63
  mode: 'ace/mode/json',
62
64
  value: node.outputJSON
63
65
  });
64
66
  if ($("#node-input-payloadPropName").val() === "") $("#node-input-payloadPropName").val("payload");
65
-
66
67
  },
67
68
  oneditsave: function () {
68
69
  var node = this;
@@ -7,7 +7,7 @@ module.exports = function (RED) {
7
7
  var node = this;
8
8
  node.curVal = true;
9
9
  node.topic = config.topic || "Inject";
10
- node.outputJSON = config.outputJSON === undefined ? "{}" : config.outputJSON;
10
+ node.outputJSON = (config.outputJSON === undefined || config.outputJSON === '') ? '{ \n\t"payload":"hello",\n\t"topic":"1"\n}' : config.outputJSON;
11
11
  setNodeStatus({ fill: "grey", shape: "dot", text: "Waiting" });
12
12
 
13
13
 
@@ -37,8 +37,8 @@ module.exports = function (RED) {
37
37
  node.outputJSON = JSON.parse(node.outputJSON);
38
38
  if (node.outputJSON.topic === undefined) node.outputJSON.topic = node.topic; // Add topic if not present
39
39
  } catch (error) {
40
- setNodeStatus({ fill: "red", shape: "dot", text: "JSON error " + error.message });
41
- RED.log.error("node.outputJSON = JSON.parse(node.outputJSON) error:" + error.message);
40
+ setNodeStatus({ fill: "red", shape: "dot", text: "JSON error " + error.trace });
41
+ RED.log.error("injectUltimate: node.outputJSON = JSON.parse(node.outputJSON) error:" + error.trace);
42
42
  }
43
43
  node.send([msgTrue, msgFalse, msgToggled, node.outputJSON]);
44
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-boolean-logic-ultimate",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "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
5
  "author": "Supergiovane (https://github.com/Supergiovane)",
6
6
  "dependencies": {