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.
- package/CHANGELOG.md +6 -0
- package/central/central.html +18 -17
- package/compare/compare.html +97 -85
- package/counter/counter.html +24 -19
- package/delay/delay.html +56 -48
- package/dimmer/dimmer.html +389 -0
- package/dimmer/dimmer.js +564 -0
- package/dimmer/locales/de-DE/dimmer.html +184 -0
- package/dimmer/locales/de-DE/dimmer.json +28 -0
- package/dimmer/locales/en-US/dimmer.html +192 -0
- package/dimmer/locales/en-US/dimmer.json +28 -0
- package/forwarder/forwarder.html +1 -1
- package/forwarder/locales/de-DE/forwarder.json +1 -1
- package/heating-curve/heating-curve.html +11 -6
- package/hysteresis/hysteresis.html +81 -69
- package/light/light.html +31 -26
- package/light/light.js +7 -15
- package/light/locales/de-DE/light.json +1 -1
- package/light/locales/en-US/light.json +3 -3
- package/logic/logic.html +79 -65
- package/long-press/locales/de-DE/long-press.json +5 -1
- package/long-press/locales/en-US/long-press.json +5 -1
- package/long-press/long-press.html +40 -20
- package/long-press/long-press.js +19 -4
- package/mixing-valve/mixing-valve.html +31 -24
- package/mixing-valve/mixing-valve.js +34 -14
- package/multi-press/locales/de-DE/multi-press.json +5 -1
- package/multi-press/locales/en-US/multi-press.json +5 -1
- package/multi-press/multi-press.html +89 -48
- package/multi-press/multi-press.js +17 -6
- package/package.json +1 -1
- package/persistence.js +2 -2
- package/scene/scene.html +15 -13
- package/scheduler/scheduler.html +7 -5
- package/shutter/shutter.html +14 -12
- package/shutter-complex/shutter-complex.html +70 -59
- package/smart_helper.js +16 -1
- package/statistic/statistic.html +26 -22
- package/text-exec/text-exec.html +10 -0
- 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.
|
package/central/central.html
CHANGED
|
@@ -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)
|
|
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")
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
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
|
-
|
|
331
|
-
|
|
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>
|
package/compare/compare.html
CHANGED
|
@@ -34,90 +34,103 @@
|
|
|
34
34
|
{
|
|
35
35
|
let node = this;
|
|
36
36
|
|
|
37
|
-
$("#node-input-comparator")
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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>
|
package/counter/counter.html
CHANGED
|
@@ -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
|
-
})
|
|
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
|
-
})
|
|
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
|
-
})
|
|
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
|
-
})
|
|
70
|
+
});
|
|
67
71
|
|
|
68
72
|
|
|
69
|
-
$("#node-input-out_message")
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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")
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
$(this).
|
|
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")
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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")
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
$(this).
|
|
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")
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
{
|