smart-nodes 0.3.32 → 0.3.34

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.
@@ -114,10 +114,10 @@ module.exports = function (RED)
114
114
  node.send(out_msg);
115
115
 
116
116
  node_settings.last_result = result;
117
+ node_settings.last_message = out_msg;
117
118
  }
118
119
 
119
120
  node_settings.last_value = value;
120
- node_settings.last_message = out_msg;
121
121
 
122
122
  setStatus(result === null);
123
123
 
@@ -168,14 +168,21 @@ module.exports = function (RED)
168
168
  })
169
169
  };
170
170
 
171
- if (config.save_state && config.resend_on_start && node_settings.last_result != null && node_settings.last_message != null)
171
+ if (config.save_state && config.resend_on_start && node_settings.last_result !== null && node_settings.last_message !== null)
172
172
  {
173
173
  setTimeout(() =>
174
174
  {
175
- if (node_settings.last_result)
176
- node.send([node_settings.last_message, null]);
175
+ if (outputs == 2)
176
+ {
177
+ if (node_settings.last_result)
178
+ node.send([node_settings.last_message, null]);
179
+ else
180
+ node.send([null, node_settings.last_message]);
181
+ }
177
182
  else
178
- node.send([null, node_settings.last_message]);
183
+ {
184
+ node.send(node_settings.last_message);
185
+ }
179
186
  }, 10000);
180
187
  }
181
188
  }
@@ -222,7 +222,7 @@ module.exports = function (RED)
222
222
  }
223
223
  else if (node_settings.last_value)
224
224
  {
225
- if (isPermanent || isMotion || timeout_end_date == null)
225
+ if (isPermanent || isMotion || max_time_on_timeout == null)
226
226
  node.status({ fill: "green", shape: "dot", text: helper.getCurrentTimeForStatus() + ": On" });
227
227
  else if (max_time_on_timeout)
228
228
  node.status({ fill: "yellow", shape: "ring", text: helper.getCurrentTimeForStatus() + ": Wait " + helper.formatDateToStatus(timeout_end_date, "until") + " for auto off" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smart-nodes",
3
- "version": "0.3.32",
3
+ "version": "0.3.34",
4
4
  "description": "Smart Nodes",
5
5
  "keywords": [
6
6
  "node-red",