smart-nodes 0.4.9 → 0.4.10

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 (40) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/central/central.html +18 -17
  3. package/compare/compare.html +97 -85
  4. package/counter/counter.html +24 -19
  5. package/delay/delay.html +56 -48
  6. package/dimmer/dimmer.html +389 -0
  7. package/dimmer/dimmer.js +564 -0
  8. package/dimmer/locales/de-DE/dimmer.html +184 -0
  9. package/dimmer/locales/de-DE/dimmer.json +28 -0
  10. package/dimmer/locales/en-US/dimmer.html +192 -0
  11. package/dimmer/locales/en-US/dimmer.json +28 -0
  12. package/forwarder/forwarder.html +1 -1
  13. package/forwarder/locales/de-DE/forwarder.json +1 -1
  14. package/heating-curve/heating-curve.html +11 -6
  15. package/hysteresis/hysteresis.html +81 -69
  16. package/light/light.html +31 -26
  17. package/light/light.js +7 -15
  18. package/light/locales/de-DE/light.json +1 -1
  19. package/light/locales/en-US/light.json +3 -3
  20. package/logic/logic.html +79 -65
  21. package/long-press/locales/de-DE/long-press.json +5 -1
  22. package/long-press/locales/en-US/long-press.json +5 -1
  23. package/long-press/long-press.html +40 -20
  24. package/long-press/long-press.js +19 -4
  25. package/mixing-valve/mixing-valve.html +31 -24
  26. package/mixing-valve/mixing-valve.js +34 -14
  27. package/multi-press/locales/de-DE/multi-press.json +5 -1
  28. package/multi-press/locales/en-US/multi-press.json +5 -1
  29. package/multi-press/multi-press.html +89 -48
  30. package/multi-press/multi-press.js +17 -6
  31. package/package.json +1 -1
  32. package/persistence.js +2 -2
  33. package/scene/scene.html +15 -13
  34. package/scheduler/scheduler.html +7 -5
  35. package/shutter/shutter.html +14 -12
  36. package/shutter-complex/shutter-complex.html +70 -59
  37. package/smart_helper.js +16 -1
  38. package/statistic/statistic.html +26 -22
  39. package/text-exec/text-exec.html +10 -0
  40. package/text-exec/text-exec.js +2 -1
package/CHANGELOG.md CHANGED
@@ -118,3 +118,9 @@
118
118
  ## Version 0.4.9:
119
119
 
120
120
  - Fixed reading config values for offset and slope in heating-curve node.
121
+
122
+ ## Version 0.4.10:
123
+
124
+ - **breaking change** (soon): Added common and separate outputs to multi press node.
125
+ Please open node config and save it to make sure it will work in later versions.
126
+ - Added common and separate outputs to long press node.
@@ -123,12 +123,13 @@
123
123
  if (flowMap[n.z])
124
124
  {
125
125
  const isChecked = node.links.indexOf(n.id) !== -1 || (n.links || []).indexOf(node.id) !== -1;
126
- if (isChecked) node.oldLinks.push(n.id);
126
+ if (isChecked)
127
+ node.oldLinks.push(n.id);
127
128
 
128
129
  flowMap[n.z].children.push({
129
130
  id: n.id,
130
131
  node: n,
131
- label: n.name || n.id,
132
+ label: n.name || n._def.paletteLabel + "(" + n.id + ")",
132
133
  selected: isChecked,
133
134
  checkbox: true,
134
135
  radio: false,
@@ -285,16 +286,18 @@
285
286
  initTreeList(node, ["smart_light-control", "smart_scene-control"]);
286
287
  });
287
288
 
288
- $("#node-input-mode").typedInput({
289
- types: [{
290
- default: "LIGHT",
291
- value: "mode",
292
- options: [
293
- { value: "LIGHT", label: node._("central.ui.light_outlet") },
294
- { value: "SHUTTER", label: node._("central.ui.cover") }
295
- ],
296
- }],
297
- });
289
+ $("#node-input-mode")
290
+ .css("max-width", "70%")
291
+ .typedInput({
292
+ types: [{
293
+ default: "LIGHT",
294
+ value: "mode",
295
+ options: [
296
+ { value: "LIGHT", label: node._("central.ui.light_outlet") },
297
+ { value: "SHUTTER", label: node._("central.ui.cover") }
298
+ ],
299
+ }],
300
+ });
298
301
 
299
302
  // Backward compatibility
300
303
  this.mode = this.mode?.toUpperCase();
@@ -303,12 +306,10 @@
303
306
  $("#node-input-mode").val(this.mode).trigger("change");
304
307
  else
305
308
  $("#node-input-mode").val("SHUTTER").trigger("change");
306
-
307
309
  },
308
310
  oneditsave: function ()
309
311
  {
310
312
  let node = this;
311
-
312
313
  onEditSave(this);
313
314
  },
314
315
  onadd: onAdd,
@@ -326,8 +327,8 @@
326
327
  <label for="node-input-mode"><i class="fa fa-arrow-right"></i> <span data-i18n="central.ui.type"></span></label>
327
328
  <input id="node-input-mode"/>
328
329
  </div>
329
- <div class="node-input-link-rows" style="position:relative; height: 30px; text-align: right;"
330
- ><div style="display:inline-block"><input type="text" id="node-input-link-target-filter" /></div
331
- ></div>
330
+ <div class="node-input-link-rows" style="position:relative; height: 30px; text-align: right;">
331
+ <div style="display:inline-block"><input type="text" id="node-input-link-target-filter" /></div>
332
+ </div>
332
333
  <div class="form-row node-input-link-row node-input-link-rows"></div>
333
334
  </script>
@@ -34,90 +34,103 @@
34
34
  {
35
35
  let node = this;
36
36
 
37
- $("#node-input-comparator").typedInput({
38
- types: [{
39
- default: "EQUAL",
40
- value: "comperator",
41
- options: [
42
- { value: "SMALLER", label: node._("compare.ui.smaller") },
43
- { value: "SMALLER_EQUAL", label: node._("compare.ui.smaller_equal") },
44
- { value: "EQUAL", label: node._("compare.ui.equal") },
45
- { value: "UNEQUAL", label: node._("compare.ui.unequal") },
46
- { value: "GREATER_EQUAL", label: node._("compare.ui.greater_equal") },
47
- { value: "GREATER", label: node._("compare.ui.greater") },
48
- ],
49
- }],
50
- });
51
-
52
- $("#node-input-value1").typedInput({
53
- type: "num",
54
- types: ["str", "num", "bool", {
55
- value: "NOTHING",
56
- label: node._("compare.ui.no_value"),
57
- icon: "fa fa-times",
58
- hasValue: false,
59
- }],
60
- typeField: "#node-input-value1_type"
61
- });
62
-
63
- $("#node-input-value2").typedInput({
64
- type: "num",
65
- types: ["str", "num", "bool", {
66
- value: "NOTHING",
67
- label: node._("compare.ui.no_value"),
68
- icon: "fa fa-times",
69
- hasValue: false,
70
- }],
71
- typeField: "#node-input-value2_type"
72
- });
73
-
74
-
75
-
76
- $("#node-input-out_true").typedInput({
77
- type: "json",
78
- types: ["json", {
79
- value: "NOTHING",
80
- label: node._("compare.ui.send_nothing"),
81
- icon: "fa fa-times",
82
- hasValue: false,
83
- }],
84
- typeField: "#node-input-out_true_type"
85
- });
86
-
87
- $("#node-input-out_false").typedInput({
88
- type: "json",
89
- types: ["json", {
90
- value: "NOTHING",
91
- label: node._("compare.ui.send_nothing"),
92
- icon: "fa fa-times",
93
- hasValue: false,
94
- }],
95
- typeField: "#node-input-out_false_type"
96
- });
97
-
98
- $("#node-input-send_only_change").typedInput({
99
- type: "bool",
100
- types: [{
101
- value: "1",
102
- value: "send_only_change",
103
- options: [
104
- { value: "true", label: node._("compare.ui.send_only_change") },
105
- { value: "false", label: node._("compare.ui.always") },
106
- ]
107
- }]
108
- });
109
-
110
- $("#node-input-outputs").typedInput({
111
- type: "num",
112
- types: [{
113
- value: "1",
114
- value: "outputs",
115
- options: [
116
- { value: "1", label: node._("compare.ui.common_output") },
117
- { value: "2", label: node._("compare.ui.separate_output") },
118
- ]
119
- }]
120
- });
37
+ $("#node-input-comparator")
38
+ .css("max-width", "70%")
39
+ .typedInput({
40
+ types: [{
41
+ default: "EQUAL",
42
+ value: "comperator",
43
+ options: [
44
+ { value: "SMALLER", label: node._("compare.ui.smaller") },
45
+ { value: "SMALLER_EQUAL", label: node._("compare.ui.smaller_equal") },
46
+ { value: "EQUAL", label: node._("compare.ui.equal") },
47
+ { value: "UNEQUAL", label: node._("compare.ui.unequal") },
48
+ { value: "GREATER_EQUAL", label: node._("compare.ui.greater_equal") },
49
+ { value: "GREATER", label: node._("compare.ui.greater") },
50
+ ],
51
+ }],
52
+ });
53
+
54
+ $("#node-input-value1")
55
+ .css("max-width", "70%")
56
+ .typedInput({
57
+ type: "num",
58
+ types: ["str", "num", "bool", {
59
+ value: "NOTHING",
60
+ label: node._("compare.ui.no_value"),
61
+ icon: "fa fa-times",
62
+ hasValue: false,
63
+ }],
64
+ typeField: "#node-input-value1_type"
65
+ });
66
+
67
+ $("#node-input-value2")
68
+ .css("max-width", "70%")
69
+ .typedInput({
70
+ type: "num",
71
+ types: ["str", "num", "bool", {
72
+ value: "NOTHING",
73
+ label: node._("compare.ui.no_value"),
74
+ icon: "fa fa-times",
75
+ hasValue: false,
76
+ }],
77
+ typeField: "#node-input-value2_type"
78
+ });
79
+
80
+
81
+ $("#node-input-out_true")
82
+ .css("max-width", "70%")
83
+ .typedInput({
84
+ type: "json",
85
+ types: ["json", {
86
+ value: "NOTHING",
87
+ label: node._("compare.ui.send_nothing"),
88
+ icon: "fa fa-times",
89
+ hasValue: false,
90
+ }],
91
+ typeField: "#node-input-out_true_type"
92
+ });
93
+
94
+ $("#node-input-out_false")
95
+ .css("max-width", "70%")
96
+ .typedInput({
97
+ type: "json",
98
+ types: ["json", {
99
+ value: "NOTHING",
100
+ label: node._("compare.ui.send_nothing"),
101
+ icon: "fa fa-times",
102
+ hasValue: false,
103
+ }],
104
+ typeField: "#node-input-out_false_type"
105
+ });
106
+
107
+ $("#node-input-send_only_change")
108
+ .css("max-width", "70%")
109
+ .typedInput({
110
+ type: "bool",
111
+ types: [{
112
+ value: "1",
113
+ value: "send_only_change",
114
+ options: [
115
+ { value: "true", label: node._("compare.ui.send_only_change") },
116
+ { value: "false", label: node._("compare.ui.always") },
117
+ ]
118
+ }]
119
+ });
120
+
121
+ $("#node-input-outputs")
122
+ .css("max-width", "70%")
123
+ .typedInput({
124
+ type: "num",
125
+ types: [{
126
+ value: "1",
127
+ value: "outputs",
128
+ options: [
129
+ { value: "1", label: node._("compare.ui.common_output") },
130
+ { value: "2", label: node._("compare.ui.separate_output") },
131
+ ]
132
+ }]
133
+ });
121
134
 
122
135
 
123
136
 
@@ -144,7 +157,6 @@
144
157
  this.value2_type = "NOTHING";
145
158
  $("#node-input-value2_type").val("NOTHING");
146
159
  }
147
-
148
160
  },
149
161
  });
150
162
  </script>
@@ -26,6 +26,7 @@
26
26
  let node = this;
27
27
 
28
28
  $("#node-input-start")
29
+ .css("max-width", "4rem")
29
30
  .spinner({
30
31
  change: function (event, ui)
31
32
  {
@@ -33,9 +34,10 @@
33
34
  value = isNaN(value) ? 0 : value;
34
35
  if (value !== this.value) $(this).spinner("value", value);
35
36
  },
36
- }).css("max-width", "4rem");
37
+ });
37
38
 
38
39
  $("#node-input-step")
40
+ .css("max-width", "4rem")
39
41
  .spinner({
40
42
  change: function (event, ui)
41
43
  {
@@ -43,9 +45,10 @@
43
45
  value = isNaN(value) ? 0 : value;
44
46
  if (value !== this.value) $(this).spinner("value", value);
45
47
  },
46
- }).css("max-width", "4rem");
48
+ });
47
49
 
48
50
  $("#node-input-min")
51
+ .css("max-width", "4rem")
49
52
  .spinner({
50
53
  change: function (event, ui)
51
54
  {
@@ -53,9 +56,10 @@
53
56
  value = isNaN(value) ? 0 : value;
54
57
  if (value !== this.value) $(this).spinner("value", value);
55
58
  },
56
- }).css("max-width", "4rem");
59
+ });
57
60
 
58
61
  $("#node-input-max")
62
+ .css("max-width", "4rem")
59
63
  .spinner({
60
64
  change: function (event, ui)
61
65
  {
@@ -63,19 +67,21 @@
63
67
  value = isNaN(value) ? 0 : value;
64
68
  if (value !== this.value) $(this).spinner("value", value);
65
69
  },
66
- }).css("max-width", "4rem");
70
+ });
67
71
 
68
72
 
69
- $("#node-input-out_message").typedInput({
70
- type: "json",
71
- types: ["json", {
72
- value: "NOTHING",
73
- label: node._("default"),
74
- icon: "fa fa-times",
75
- hasValue: false,
76
- }],
77
- typeField: "#node-input-out_message_type"
78
- });
73
+ $("#node-input-out_message")
74
+ .css("max-width", "70%")
75
+ .typedInput({
76
+ type: "json",
77
+ types: ["json", {
78
+ value: "NOTHING",
79
+ label: node._("counter.ui.default"),
80
+ icon: "fa fa-times",
81
+ hasValue: false,
82
+ }],
83
+ typeField: "#node-input-out_message_type"
84
+ });
79
85
 
80
86
  $("#node-input-save_state").on("change", ev =>
81
87
  {
@@ -92,7 +98,6 @@
92
98
  this.out_message_type = "NOTHING";
93
99
  $("#node-input-out_message_type").val("NOTHING");
94
100
  }
95
-
96
101
  }
97
102
  });
98
103
  </script>
@@ -119,7 +124,7 @@
119
124
  <input id="node-input-max" data-i18n="[placeholder]counter.ui.max">
120
125
  </div>
121
126
  <hr/>
122
- <h4 style="margin: 0.5rem 0;"><span data-i18n="compare.ui.output_messages"></span></h4>
127
+ <h4 style="margin: 0.5rem 0;"><span data-i18n="counter.ui.output_messages"></span></h4>
123
128
  <div class="form-row">
124
129
  <label for="node-input-out_message"><i class="fa fa-check-circle"></i> <span data-i18n="counter.ui.message"></span></label>
125
130
  <input type="text" id="node-input-out_message"/>
@@ -130,13 +135,13 @@
130
135
  <div data-i18n="[html]counter.ui.note_text"></div>
131
136
  </div>
132
137
  <hr/>
133
- <h4 style="margin: 0.5rem 0;"><span data-i18n="compare.ui.system_start"></span></h4>
138
+ <h4 style="margin: 0.5rem 0;"><span data-i18n="counter.ui.system_start"></span></h4>
134
139
  <div class="form-row">
135
140
  <input type="checkbox" id="node-input-save_state" style="width: 20px;" />
136
- <label for="node-input-save_state" style="width: calc(100% - 30px);"><span data-i18n="compare.ui.save_state"></span></label>
141
+ <label for="node-input-save_state" style="width: calc(100% - 30px);"><span data-i18n="counter.ui.save_state"></span></label>
137
142
  </div>
138
143
  <div class="form-row" id="resend_on_start_row">
139
144
  <input type="checkbox" id="node-input-resend_on_start" style="width: 20px;" />
140
- <label for="node-input-resend_on_start" style="width: calc(100% - 30px);"><span data-i18n="compare.ui.send_after_start"></span></label>
145
+ <label for="node-input-resend_on_start" style="width: calc(100% - 30px);"><span data-i18n="counter.ui.send_after_start"></span></label>
141
146
  </div>
142
147
  </script>
package/delay/delay.html CHANGED
@@ -24,57 +24,65 @@
24
24
  {
25
25
  let node = this;
26
26
 
27
- $("#node-input-on_delay").spinner({
28
- min: 0,
29
- change: function (event, ui)
30
- {
31
- var value = parseInt(this.value);
32
- value = isNaN(value) ? 0 : value;
33
- value = Math.max(value, parseInt($(this).attr("aria-valuemin")));
34
- // value = Math.min(value, parseInt($(this).attr("aria-valuemax")));
35
- if (value !== this.value)
36
- $(this).spinner("value", value);
37
- }
38
- });
27
+ $("#node-input-on_delay")
28
+ .css("max-width", "4rem")
29
+ .spinner({
30
+ min: 0,
31
+ change: function (event, ui)
32
+ {
33
+ var value = parseInt(this.value);
34
+ value = isNaN(value) ? 0 : value;
35
+ value = Math.max(value, parseInt($(this).attr("aria-valuemin")));
36
+ // value = Math.min(value, parseInt($(this).attr("aria-valuemax")));
37
+ if (value !== this.value)
38
+ $(this).spinner("value", value);
39
+ }
40
+ });
39
41
 
40
- $("#node-input-on_delay_unit").css("max-width", "10rem").typedInput({
41
- types: [{
42
- default: "s",
43
- value: "on_delay_unit",
44
- options: [
45
- { value: "ms", label: node._("delay.ui.milliseconds") },
46
- { value: "s", label: node._("delay.ui.seconds") },
47
- { value: "min", label: node._("delay.ui.minutes") },
48
- { value: "h", label: node._("delay.ui.hours") },
49
- ]
50
- }]
51
- });
42
+ $("#node-input-on_delay_unit")
43
+ .css("max-width", "10rem")
44
+ .typedInput({
45
+ types: [{
46
+ default: "s",
47
+ value: "on_delay_unit",
48
+ options: [
49
+ { value: "ms", label: node._("delay.ui.milliseconds") },
50
+ { value: "s", label: node._("delay.ui.seconds") },
51
+ { value: "min", label: node._("delay.ui.minutes") },
52
+ { value: "h", label: node._("delay.ui.hours") },
53
+ ]
54
+ }]
55
+ });
52
56
 
53
- $("#node-input-off_delay").spinner({
54
- min: 0,
55
- change: function (event, ui)
56
- {
57
- var value = parseInt(this.value);
58
- value = isNaN(value) ? 0 : value;
59
- value = Math.max(value, parseInt($(this).attr("aria-valuemin")));
60
- // value = Math.min(value, parseInt($(this).attr("aria-valuemax")));
61
- if (value !== this.value)
62
- $(this).spinner("value", value);
63
- }
64
- });
57
+ $("#node-input-off_delay")
58
+ .css("max-width", "4rem")
59
+ .spinner({
60
+ min: 0,
61
+ change: function (event, ui)
62
+ {
63
+ var value = parseInt(this.value);
64
+ value = isNaN(value) ? 0 : value;
65
+ value = Math.max(value, parseInt($(this).attr("aria-valuemin")));
66
+ // value = Math.min(value, parseInt($(this).attr("aria-valuemax")));
67
+ if (value !== this.value)
68
+ $(this).spinner("value", value);
69
+ }
70
+ });
65
71
 
66
- $("#node-input-off_delay_unit").css("max-width", "10rem").typedInput({
67
- types: [{
68
- default: "s",
69
- value: "on_delay_unit",
70
- options: [
71
- { value: "ms", label: node._("delay.ui.milliseconds") },
72
- { value: "s", label: node._("delay.ui.seconds") },
73
- { value: "min", label: node._("delay.ui.minutes") },
74
- { value: "h", label: node._("delay.ui.hours") },
75
- ]
76
- }]
77
- });
72
+ $("#node-input-off_delay_unit")
73
+ .css("max-width", "10rem")
74
+ .typedInput({
75
+ types: [{
76
+ default: "s",
77
+ value: "on_delay_unit",
78
+ options: [
79
+ { value: "ms", label: node._("delay.ui.milliseconds") },
80
+ { value: "s", label: node._("delay.ui.seconds") },
81
+ { value: "min", label: node._("delay.ui.minutes") },
82
+ { value: "h", label: node._("delay.ui.hours") },
83
+ ]
84
+ }]
85
+ });
78
86
 
79
87
  $("#node-input-save_state").on("change", ev =>
80
88
  {