@bldgblocks/node-red-contrib-control 0.1.31 → 0.1.33

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.
Files changed (71) hide show
  1. package/nodes/accumulate-block.html +1 -1
  2. package/nodes/add-block.html +1 -1
  3. package/nodes/analog-switch-block.html +1 -1
  4. package/nodes/and-block.html +1 -1
  5. package/nodes/average-block.html +1 -1
  6. package/nodes/boolean-switch-block.html +1 -1
  7. package/nodes/boolean-to-number-block.html +1 -1
  8. package/nodes/cache-block.html +1 -1
  9. package/nodes/call-status-block.html +1 -1
  10. package/nodes/changeover-block.html +1 -1
  11. package/nodes/comment-block.html +1 -1
  12. package/nodes/compare-block.html +1 -1
  13. package/nodes/contextual-label-block.html +1 -1
  14. package/nodes/convert-block.html +1 -1
  15. package/nodes/count-block.html +2 -2
  16. package/nodes/delay-block.html +1 -1
  17. package/nodes/divide-block.html +1 -1
  18. package/nodes/edge-block.html +1 -1
  19. package/nodes/enum-switch-block.html +1 -1
  20. package/nodes/frequency-block.html +1 -1
  21. package/nodes/global-getter.html +43 -4
  22. package/nodes/global-getter.js +114 -34
  23. package/nodes/global-setter.html +21 -10
  24. package/nodes/global-setter.js +154 -79
  25. package/nodes/history-collector.html +283 -0
  26. package/nodes/history-collector.js +150 -0
  27. package/nodes/history-config.html +236 -0
  28. package/nodes/history-config.js +8 -0
  29. package/nodes/hysteresis-block.html +1 -1
  30. package/nodes/interpolate-block.html +1 -1
  31. package/nodes/latch-block.html +1 -1
  32. package/nodes/load-sequence-block.html +1 -1
  33. package/nodes/max-block.html +1 -1
  34. package/nodes/memory-block.html +1 -1
  35. package/nodes/min-block.html +1 -1
  36. package/nodes/minmax-block.html +1 -1
  37. package/nodes/modulo-block.html +1 -1
  38. package/nodes/multiply-block.html +1 -1
  39. package/nodes/negate-block.html +1 -1
  40. package/nodes/network-point-registry.html +86 -0
  41. package/nodes/network-point-registry.js +90 -0
  42. package/nodes/network-read.html +56 -0
  43. package/nodes/network-read.js +59 -0
  44. package/nodes/network-register.html +110 -0
  45. package/nodes/network-register.js +161 -0
  46. package/nodes/network-write.html +64 -0
  47. package/nodes/network-write.js +126 -0
  48. package/nodes/nullify-block.html +1 -1
  49. package/nodes/on-change-block.html +1 -1
  50. package/nodes/oneshot-block.html +1 -1
  51. package/nodes/or-block.html +1 -1
  52. package/nodes/pid-block.html +1 -1
  53. package/nodes/priority-block.html +1 -1
  54. package/nodes/rate-limit-block.html +2 -2
  55. package/nodes/rate-of-change-block.html +1 -1
  56. package/nodes/rate-of-change-block.js +5 -2
  57. package/nodes/round-block.html +6 -5
  58. package/nodes/round-block.js +5 -3
  59. package/nodes/saw-tooth-wave-block.html +2 -2
  60. package/nodes/scale-range-block.html +1 -1
  61. package/nodes/sine-wave-block.html +2 -2
  62. package/nodes/string-builder-block.html +1 -1
  63. package/nodes/subtract-block.html +1 -1
  64. package/nodes/thermistor-block.html +1 -1
  65. package/nodes/tick-tock-block.html +2 -2
  66. package/nodes/time-sequence-block.html +1 -1
  67. package/nodes/triangle-wave-block.html +2 -2
  68. package/nodes/tstat-block.html +1 -1
  69. package/nodes/units-block.html +8 -38
  70. package/nodes/units-block.js +3 -42
  71. package/package.json +11 -4
@@ -15,7 +15,7 @@
15
15
 
16
16
  <script type="text/javascript">
17
17
  RED.nodes.registerType("accumulate-block", {
18
- category: "control",
18
+ category: "bldgblocks control",
19
19
  color: "#301934",
20
20
  defaults: {
21
21
  name: { value: "" },
@@ -11,7 +11,7 @@
11
11
 
12
12
  <script type="text/javascript">
13
13
  RED.nodes.registerType("add-block", {
14
- category: "control",
14
+ category: "bldgblocks control",
15
15
  color: "#301934",
16
16
  defaults: {
17
17
  name: { value: "" },
@@ -13,7 +13,7 @@
13
13
  <!-- JavaScript Section: Registers the node and handles editor logic -->
14
14
  <script type="text/javascript">
15
15
  RED.nodes.registerType("analog-switch-block", {
16
- category: "control",
16
+ category: "bldgblocks control",
17
17
  color: "#301934",
18
18
  defaults: {
19
19
  name: { value: "" },
@@ -11,7 +11,7 @@
11
11
 
12
12
  <script type="text/javascript">
13
13
  RED.nodes.registerType("and-block", {
14
- category: "control",
14
+ category: "bldgblocks control",
15
15
  color: "#301934",
16
16
  defaults: {
17
17
  name: { value: "" },
@@ -21,7 +21,7 @@
21
21
 
22
22
  <script type="text/javascript">
23
23
  RED.nodes.registerType("average-block", {
24
- category: "control",
24
+ category: "bldgblocks control",
25
25
  color: "#301934",
26
26
  defaults: {
27
27
  name: { value: "" },
@@ -9,7 +9,7 @@
9
9
  <!-- JavaScript Section -->
10
10
  <script type="text/javascript">
11
11
  RED.nodes.registerType("boolean-switch-block", {
12
- category: "control",
12
+ category: "bldgblocks control",
13
13
  color: "#301934",
14
14
  defaults: {
15
15
  name: { value: "" },
@@ -13,7 +13,7 @@
13
13
  <!-- JavaScript Section -->
14
14
  <script type="text/javascript">
15
15
  RED.nodes.registerType("boolean-to-number-block", {
16
- category: "control",
16
+ category: "bldgblocks control",
17
17
  color: "#301934",
18
18
  defaults: {
19
19
  name: { value: "" },
@@ -13,7 +13,7 @@
13
13
  <!-- JavaScript Section: Registers the node and handles editor logic -->
14
14
  <script type="text/javascript">
15
15
  RED.nodes.registerType("cache-block", {
16
- category: "control",
16
+ category: "bldgblocks control",
17
17
  color: "#301934",
18
18
  defaults: {
19
19
  name: { value: "" },
@@ -33,7 +33,7 @@
33
33
  <!-- JavaScript Section: Registers the node and handles editor logic -->
34
34
  <script type="text/javascript">
35
35
  RED.nodes.registerType("call-status-block", {
36
- category: "control",
36
+ category: "bldgblocks control",
37
37
  color: "#301934",
38
38
  defaults: {
39
39
  name: { value: "" },
@@ -93,7 +93,7 @@
93
93
 
94
94
  <script type="text/javascript">
95
95
  RED.nodes.registerType("changeover-block", {
96
- category: "control",
96
+ category: "bldgblocks control",
97
97
  color: "#301934",
98
98
  defaults: {
99
99
  name: { value: "" },
@@ -19,7 +19,7 @@
19
19
 
20
20
  <script type="text/javascript">
21
21
  RED.nodes.registerType("comment-block", {
22
- category: "control",
22
+ category: "bldgblocks control",
23
23
  color: "#301934",
24
24
  defaults: {
25
25
  name: { value: "comment" },
@@ -13,7 +13,7 @@
13
13
  <!-- JavaScript Section: Registers the node and handles editor logic -->
14
14
  <script type="text/javascript">
15
15
  RED.nodes.registerType("compare-block", {
16
- category: "control",
16
+ category: "bldgblocks control",
17
17
  color: "#301934",
18
18
  defaults: {
19
19
  name: { value: "" },
@@ -15,7 +15,7 @@
15
15
 
16
16
  <script type="text/javascript">
17
17
  RED.nodes.registerType("contextual-label-block", {
18
- category: "control",
18
+ category: "bldgblocks control",
19
19
  color: "#301934",
20
20
  defaults: {
21
21
  name: { value: "" },
@@ -58,7 +58,7 @@
58
58
 
59
59
  <script type="text/javascript">
60
60
  RED.nodes.registerType("convert-block", {
61
- category: "control",
61
+ category: "bldgblocks control",
62
62
  color: "#301934",
63
63
  defaults: {
64
64
  name: { value: "" },
@@ -9,7 +9,7 @@
9
9
  <!-- JavaScript Section: Registers the node and handles editor logic -->
10
10
  <script type="text/javascript">
11
11
  RED.nodes.registerType("count-block", {
12
- category: "control",
12
+ category: "bldgblocks control",
13
13
  color: "#301934",
14
14
  defaults: {
15
15
  name: { value: "" }
@@ -18,7 +18,7 @@
18
18
  outputs: 1,
19
19
  inputLabels: ["input"],
20
20
  outputLabels: ["count"],
21
- icon: "font-awesome/fa-tally",
21
+ icon: "font-awesome/fa-calculator",
22
22
  paletteLabel: "count",
23
23
  label: function() {
24
24
  return this.name || "count";
@@ -33,7 +33,7 @@
33
33
  <!-- JavaScript Section: Registers the node and handles editor logic -->
34
34
  <script type="text/javascript">
35
35
  RED.nodes.registerType("delay-block", {
36
- category: "control",
36
+ category: "bldgblocks control",
37
37
  color: "#301934",
38
38
  defaults: {
39
39
  name: { value: "" },
@@ -11,7 +11,7 @@
11
11
 
12
12
  <script type="text/javascript">
13
13
  RED.nodes.registerType("divide-block", {
14
- category: "control",
14
+ category: "bldgblocks control",
15
15
  color: "#301934",
16
16
  defaults: {
17
17
  name: { value: "" },
@@ -16,7 +16,7 @@
16
16
  <!-- JavaScript Section -->
17
17
  <script type="text/javascript">
18
18
  RED.nodes.registerType("edge-block", {
19
- category: "control",
19
+ category: "bldgblocks control",
20
20
  color: "#301934",
21
21
  defaults: {
22
22
  name: { value: "" },
@@ -31,7 +31,7 @@
31
31
 
32
32
  <script type="text/javascript">
33
33
  RED.nodes.registerType("enum-switch-block", {
34
- category: "control",
34
+ category: "bldgblocks control",
35
35
  color: "#301934",
36
36
  defaults: {
37
37
  name: { value: "" },
@@ -9,7 +9,7 @@
9
9
  <!-- JavaScript Section: Registers the node and handles editor logic -->
10
10
  <script type="text/javascript">
11
11
  RED.nodes.registerType("frequency-block", {
12
- category: "control",
12
+ category: "bldgblocks control",
13
13
  color: "#301934",
14
14
  defaults: {
15
15
  name: { value: "" }
@@ -12,7 +12,6 @@
12
12
  </button>
13
13
  </div>
14
14
 
15
- <!-- NEW: Trigger Mode Selection -->
16
15
  <div class="form-row">
17
16
  <label for="node-input-updates"><i class="fa fa-bolt"></i> Trigger</label>
18
17
  <select id="node-input-updates" style="width: 70%;">
@@ -26,6 +25,14 @@
26
25
  <input type="text" id="node-input-outputProperty" placeholder="payload" style="width:70%;">
27
26
  </div>
28
27
 
28
+ <div class="form-row">
29
+ <label for="node-input-detail"><i class="fa fa-book"></i> Detail</label>
30
+ <select id="node-input-detail" style="width: 70%;">
31
+ <option value="getValue">Get Simple Value</option>
32
+ <option value="getObject">Get Full Object</option>
33
+ </select>
34
+ </div>
35
+
29
36
  <div class="form-tips">
30
37
  <b>Note:</b> Targeting by Node ID allows the source path to change without breaking this link.
31
38
  </div>
@@ -33,13 +40,14 @@
33
40
 
34
41
  <script type="text/javascript">
35
42
  RED.nodes.registerType('global-getter', {
36
- category: 'control',
43
+ category: "bldgblocks control",
37
44
  color: '#3FADB5',
38
45
  defaults: {
39
46
  name: { value: "" },
40
47
  targetNode: { value: "", required: true },
41
48
  outputProperty: { value: "payload", required: true },
42
- updates: { value: "always", required: true }
49
+ updates: { value: "always", required: true },
50
+ detail: {value: "getObject", required: true }
43
51
  },
44
52
  inputs: 1,
45
53
  outputs: 1,
@@ -48,7 +56,7 @@
48
56
  if (this.targetNode) {
49
57
  const target = RED.nodes.node(this.targetNode);
50
58
  if (target) {
51
- let lbl = target.path || target.name;
59
+ let lbl = target.name || target.path;
52
60
  if(lbl && lbl.startsWith("#") && lbl.includes(":")) {
53
61
  lbl = lbl.substring(lbl.indexOf(":") + 1);
54
62
  }
@@ -91,3 +99,34 @@
91
99
  }
92
100
  });
93
101
  </script>
102
+
103
+ <!-- Help Section -->
104
+ <script type="text/markdown" data-help-name="global-setter">
105
+ Manage a global variable in a repeatable way.
106
+
107
+ ### Inputs
108
+ Retreived object will overwrite msg.
109
+
110
+ ### Outputs
111
+ : payload (object) : The stored object with values and metadata.
112
+
113
+ ### Details
114
+ Global variables are meant to be retrieved in other places, this necessarily means managing the same string in multiple places.
115
+
116
+ This node allows you to get a global variable anywhere from one source, while supporting rename and deletion.
117
+
118
+ The source can be found using the search button. The payload property can be specified and can be set to only the value for chaining.
119
+
120
+ Reactive updates means every time the source is updated those nodes will receive the new value via event.
121
+
122
+ ### Status
123
+ - Green (dot): Configuration update
124
+ - Blue (dot): State changed
125
+ - Blue (ring): State unchanged
126
+ - Red (ring): Error
127
+ - Yellow (ring): Warning
128
+
129
+ ### References
130
+ - [Node-RED Documentation](https://nodered.org/docs/)
131
+ - [GitHub Repository](https://github.com/BldgBlocks/node-red-contrib-buildingblocks-control.git)
132
+ </script>
@@ -5,38 +5,44 @@ module.exports = function(RED) {
5
5
  node.targetNodeId = config.targetNode;
6
6
  node.outputProperty = config.outputProperty || "payload";
7
7
  node.updates = config.updates;
8
-
9
- const setterNode = RED.nodes.getNode(node.targetNodeId);
8
+ node.detail = config.detail;
9
+
10
+ let setterNode = null;
11
+ let retryAction = null;
12
+ let healthCheckAction = null;
13
+ let updateListener = null;
14
+ let retryCount = 0;
15
+ const retryDelays = [0, 100, 500, 1000, 2000, 4000, 8000, 16000];
16
+ const maxRetries = retryDelays.length - 1;
10
17
 
11
- // --- HELPER: Process Wrapper and Send Msg ---
18
+ // --- Process Wrapper and Send Msg ---
12
19
  function sendValue(storedObject, msgToReuse) {
13
20
  const msg = msgToReuse || {};
14
21
 
15
- if (storedObject !== undefined) {
22
+ if (storedObject !== undefined && storedObject !== null) {
16
23
 
17
24
  // CHECK: Is this our Wrapper Format? (Created by Global Setter)
18
- if (storedObject && typeof storedObject === 'object' && storedObject.hasOwnProperty('value')) {
19
-
20
- // 1. Separate the Value from everything else (Rest operator)
21
- // 'attributes' will contain: priority, units, metadata, topic, etc.
22
- const { value, ...attributes } = storedObject;
25
+ if (storedObject && typeof storedObject === 'object' && storedObject.hasOwnProperty('value')) {
23
26
 
24
- // 2. Set the Main Output (e.g. msg.payload = 75)
25
- RED.util.setMessageProperty(msg, node.outputProperty, value);
26
-
27
- // 3. Merge all attributes onto the msg root
27
+ // Merge all attributes onto the msg root
28
28
  // This automatically handles priority, units, metadata, and any future fields
29
- Object.assign(msg, attributes);
29
+ if (node.detail === "getObject") {
30
+ Object.assign(msg, storedObject);
31
+ }
32
+
33
+ // Set the Main Output (e.g. msg.payload = 75)
34
+ RED.util.setMessageProperty(msg, node.outputProperty, storedObject.value);
30
35
 
31
36
  } else {
32
- // Handle Legacy/Raw values (not created by your Setter)
37
+ // Handle Legacy/Raw values (not created by Setter)
33
38
  RED.util.setMessageProperty(msg, node.outputProperty, storedObject);
34
39
  msg.metadata = { path: setterNode ? setterNode.varName : "unknown", legacy: true };
35
40
  }
36
41
 
37
- // Visual Status
38
- const valDisplay = RED.util.getMessageProperty(msg, node.outputProperty);
39
- node.status({ fill: "blue", shape: "dot", text: `Get: ${valDisplay}` });
42
+ // Update Status
43
+ let valDisplay = RED.util.getMessageProperty(msg, node.outputProperty);
44
+ valDisplay = typeof valDisplay === "number" ? valDisplay : valDisplay;
45
+ node.status({ fill: "blue", shape: "dot", text: `get: ${valDisplay}` });
40
46
 
41
47
  node.send(msg);
42
48
 
@@ -45,13 +51,87 @@ module.exports = function(RED) {
45
51
  }
46
52
  }
47
53
 
48
- // --- 1. HANDLE MANUAL INPUT ---
54
+ // --- Manage Event Subscription ---
55
+ function establishListener() {
56
+ // Look for source node
57
+ setterNode = RED.nodes.getNode(node.targetNodeId);
58
+
59
+ // If found, subscribe
60
+ if (setterNode && setterNode.varName && node.updates === 'always') {
61
+ if (updateListener) {
62
+ // Remove existing listener if we're retrying
63
+ RED.events.removeListener("bldgblocks-global-update", updateListener);
64
+ }
65
+
66
+ updateListener = function(evt) {
67
+ if (evt.key === setterNode.varName && evt.store === setterNode.storeName) {
68
+ sendValue(evt.data, {});
69
+ }
70
+ };
71
+
72
+ RED.events.on("bldgblocks-global-update", updateListener);
73
+
74
+ // Clear retry interval once successful
75
+ if (retryAction) {
76
+ clearInterval(retryAction);
77
+ retryAction = null;
78
+ }
79
+
80
+ node.status({ fill: "green", shape: "dot", text: "Connected" });
81
+ return true;
82
+ }
83
+ return false;
84
+ }
85
+
86
+ // --- Maintain event subscription ---
87
+ function startHealthCheck() {
88
+ const healthCheckAction = () => {
89
+ const listeners = RED.events.listeners("bldgblocks-global-update");
90
+ const hasOurListener = listeners.includes(updateListener);
91
+
92
+ if (!hasOurListener) {
93
+ node.warn("Event listener lost, reconnecting...");
94
+ if (establishListener()) {
95
+ node.status({ fill: "green", shape: "dot", text: "Reconnected" });
96
+ }
97
+ }
98
+
99
+ // Schedule next health check regardless of outcome
100
+ setTimeout(healthCheckAction, 30000);
101
+ };
102
+ // Inital start
103
+ setTimeout(healthCheckAction, 30000);
104
+ }
105
+
106
+ function subscribeWithRetry() {
107
+ // Recursive retry
108
+ retryAction = () => {
109
+ if (retryCount >= maxRetries) {
110
+ node.error("Failed to connect to setter node after multiple attempts");
111
+ node.status({ fill: "red", shape: "ring", text: "Connection failed" });
112
+ return;
113
+ }
114
+
115
+ if (establishListener()) {
116
+ retryCount = 0;
117
+ return; // Success
118
+ }
119
+
120
+ retryCount++;
121
+ setTimeout(retryAction, retryDelays[Math.min(retryCount, maxRetries - 1)]);
122
+ };
123
+
124
+ setTimeout(retryAction, retryDelays[0]);
125
+ }
126
+
127
+ // --- HANDLE MANUAL INPUT ---
49
128
  node.on('input', function(msg, send, done) {
50
129
  send = send || function() { node.send.apply(node, arguments); };
51
130
 
131
+ setterNode ??= RED.nodes.getNode(node.targetNodeId);
132
+
52
133
  if (setterNode && setterNode.varName) {
53
- const globalContext = node.context().global;
54
- const storedObject = globalContext.get(setterNode.varName, setterNode.storeName);
134
+ const storedObject = node.context().global.get(setterNode.varName, setterNode.storeName);
55
135
  sendValue(storedObject, msg);
56
136
  } else {
57
137
  node.warn("Source node not found or not configured.");
@@ -61,24 +141,24 @@ module.exports = function(RED) {
61
141
  if (done) done();
62
142
  });
63
143
 
64
- // --- 2. HANDLE REACTIVE UPDATES ---
65
- let updateListener = null;
66
-
67
- if (node.updates === 'always' && setterNode && setterNode.varName) {
68
- updateListener = function(evt) {
69
- if (evt.key === setterNode.varName && evt.store === setterNode.storeName) {
70
- // Pass data directly from event
71
- sendValue(evt.data, {});
72
- }
73
- };
74
- RED.events.on("bldgblocks-global-update", updateListener);
144
+ // --- HANDLE REACTIVE UPDATES ---
145
+ if (node.updates === 'always') {
146
+ subscribeWithRetry();
147
+ startHealthCheck();
75
148
  }
76
149
 
77
150
  // --- CLEANUP ---
78
- node.on('close', function() {
79
- if (updateListener) {
151
+ node.on('close', function(removed, done) {
152
+ if (healthCheckAction) {
153
+ clearInterval(healthCheckAction);
154
+ }
155
+ if (retryAction) {
156
+ clearInterval(retryAction);
157
+ }
158
+ if (removed && updateListener) {
80
159
  RED.events.removeListener("bldgblocks-global-update", updateListener);
81
160
  }
161
+ done();
82
162
  });
83
163
  }
84
164
  RED.nodes.registerType("global-getter", GlobalGetterNode);
@@ -20,45 +20,56 @@
20
20
  <hr>
21
21
 
22
22
  <div class="form-row">
23
- <label for="node-input-defaultValue" title="Static default value to ensure one exists. You may write to default through message configuration."><i class="fa fa-undo"></i> Default</label>
23
+ <label for="node-input-defaultValue" title="Manual default value to ensure one always exists. You may write to default through message configuration but may not set it to null."><i class="fa fa-undo"></i> Default</label>
24
24
  <input type="text" id="node-input-defaultValue" placeholder="e.g. 0 or false">
25
+ <input type="hidden" id="node-input-defaultValueType">
25
26
  </div>
26
27
 
27
28
  <div class="form-tips">
28
- <b>Note:</b> This node writes to the selected <b>Priority Level</b>. The actual Global Variable value will be the highest active priority.
29
+ <b>Note:</b> This node writes to the selected <b>Priority</b>, manually, by msg or flow. The actual Global Variable value will be the highest active priority.
29
30
  </div>
30
31
  </script>
31
32
 
32
33
  <script type="text/javascript">
33
34
  RED.nodes.registerType('global-setter', {
34
- category: 'control',
35
+ category: "bldgblocks control",
35
36
  color: '#E2D96E',
36
37
  defaults: {
37
38
  name: { value: "" },
38
39
  path: { value: "", required: true },
39
40
  property: { value: "payload", required: true },
40
41
  defaultValue: { value: "", required: true },
41
- writePriority: { value: "16", required: true },
42
+ defaultValueType: { value: "num", required: true },
43
+ writePriority: { value: "default", required: true },
42
44
  writePriorityType: { value: "dropdown" }
43
45
  },
44
46
  inputs: 1,
45
47
  outputs: 1,
46
48
  icon: "font-awesome/fa-align-right",
47
49
  label: function() {
48
- let lbl = this.path;
49
- if (lbl && lbl.startsWith("#") && lbl.includes(":")) {
50
- lbl = lbl.substring(lbl.indexOf(":") + 1);
50
+ let lbl = this.name || this.path;
51
+ if (lbl) {
52
+ if (lbl && lbl.startsWith("#") && lbl.includes(":")) {
53
+ lbl = lbl.substring(lbl.indexOf(":") + 1);
54
+ }
55
+ return "set: " + lbl;
51
56
  }
52
- return this.name || "set: " + lbl || "global set";
57
+ return this.name || "global set";
53
58
  },
54
59
  paletteLabel: "global set",
55
60
  oneditprepare: function() {
61
+ const node = this;
62
+
56
63
  // These are read as strings not evaluated typed-inputs.
57
64
  $("#node-input-path").typedInput({ types: ['global'] });
58
65
  // getMessageProperty handles msg access on the incoming message at the specified path.
59
66
  $("#node-input-property").typedInput({ types: ['msg'] });
60
67
  // Default for the default value, meaning it should only be manually set. You can still pass default values through messages.
61
- $("#node-input-defaultValue").typedInput({ types: ['str','num','bool'] });
68
+ $("#node-input-defaultValue").typedInput({
69
+ default: "num",
70
+ types: ["str", "num", "bool", "json"],
71
+ typeField: "#node-input-defaultValueType"
72
+ }).typedInput("type", node.defaultValueType || "num").typedInput("value", node.defaultValue);
62
73
 
63
74
  $("#node-input-writePriority").typedInput({
64
75
  default: "dropdown",
@@ -80,7 +91,7 @@
80
91
  { value: "13", label: "13"},
81
92
  { value: "14", label: "14"},
82
93
  { value: "15", label: "15"},
83
- { value: "16", label: "16 (Schedule/Logic)"},
94
+ { value: "16", label: "16 (Network Logic)"},
84
95
  { value: "default", label: "default (fallback)"},
85
96
  ]
86
97
  }, "msg", "flow"],