Skip to content

Commit ea34ed4

Browse files
committed
fix node properties
1 parent 6248e45 commit ea34ed4

File tree

10 files changed

+34
-45
lines changed

10 files changed

+34
-45
lines changed

examples/sacn-scene-controller.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"type": "sacn_in",
1313
"z": "5b7a58776b1aebd9",
1414
"universe": 1,
15-
"port": 5568,
15+
"port": "",
1616
"interface": "",
1717
"mode": "htp",
1818
"output": "full",
@@ -30,7 +30,7 @@
3030
"type": "sacn_in",
3131
"z": "5b7a58776b1aebd9",
3232
"universe": "2",
33-
"port": 5568,
33+
"port": "",
3434
"interface": "",
3535
"mode": "ltp",
3636
"output": "full",
@@ -191,7 +191,7 @@
191191
"type": "sacn_out",
192192
"z": "5b7a58776b1aebd9",
193193
"universe": "3",
194-
"port": 5568,
194+
"port": "",
195195
"interface": "",
196196
"speed": "30",
197197
"priority": 100,
@@ -205,7 +205,7 @@
205205
"type": "sacn_out",
206206
"z": "5b7a58776b1aebd9",
207207
"universe": "4",
208-
"port": 5568,
208+
"port": "",
209209
"interface": "",
210210
"speed": "30",
211211
"priority": 100,

src/sacn/sacn-in.html

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
44
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name" style="width:70%;" />
55
</div>
6-
<div class="form-row">
7-
<label for="node-input-property"
8-
><i class="fa fa-ellipsis-h"></i> <span data-i18n="node-red:common.label.property"></span
9-
></label>
10-
<input type="text" id="node-input-property" style="width:70%;" />
11-
<input type="hidden" id="node-input-outputs" />
12-
</div>
136

147
<div class="form-row">
158
<label for="node-input-universe"
@@ -53,12 +46,14 @@
5346
category: "sACN",
5447
color: "#dcc515",
5548
defaults: {
49+
name: {
50+
value: "Scene-Controller",
51+
},
5652
universe: {
5753
value: 1,
5854
required: true,
5955
},
6056
port: {
61-
value: 5568,
6257
required: false,
6358
},
6459
interface: {
@@ -81,13 +76,13 @@
8176
outputs: 1,
8277
paletteLabel: "sACN in",
8378
icon: "bulb.png",
84-
label: () => {
79+
label: function () {
8580
return this.name || "sACN";
8681
},
87-
labelStyle: () => {
82+
labelStyle: function () {
8883
return this.name ? "node_label_italic" : "";
8984
},
90-
oneditprepare: () => {
85+
oneditprepare: function () {
9186
const outputCount = $("#node-input-outputs").val("{}");
9287
$("#node-input-universe").change(() => {
9388
const outputs = {};
@@ -97,13 +92,6 @@
9792
}
9893
outputCount.val(JSON.stringify(outputs));
9994
});
100-
if (this.property === undefined) {
101-
$("#node-input-property").val("payload");
102-
}
103-
$("#node-input-property").typedInput({
104-
default: "msg",
105-
types: ["msg"],
106-
});
10795
},
10896
});
10997
</script>

src/sacn/sacn-in.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/sacn/sacn-in.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/sacn/sacn-out.html

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
44
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name" style="width:70%;" />
55
</div>
6-
<div class="form-row">
7-
<label for="node-input-property"
8-
><i class="fa fa-ellipsis-h"></i> <span data-i18n="node-red:common.label.property"></span
9-
></label>
10-
<input type="text" id="node-input-property" style="width:70%;" />
11-
</div>
126

137
<div class="form-row">
148
<label for="node-input-universe"
@@ -62,12 +56,14 @@
6256
category: "sACN",
6357
color: "#dcc515",
6458
defaults: {
59+
name: {
60+
value: "Scene-Controller",
61+
},
6562
universe: {
6663
value: 1,
6764
required: true,
6865
},
6966
port: {
70-
value: 5568,
7167
required: false,
7268
},
7369
interface: {
@@ -91,20 +87,11 @@
9187
outputs: 0,
9288
paletteLabel: "sACN out",
9389
icon: "bulb.png",
94-
label: () => {
90+
label: function () {
9591
return this.name || "sACN";
9692
},
97-
labelStyle: () => {
93+
labelStyle: function () {
9894
return this.name ? "node_label_italic" : "";
9995
},
100-
oneditprepare: () => {
101-
if (this.property === undefined) {
102-
$("#node-input-property").val("payload");
103-
}
104-
$("#node-input-property").typedInput({
105-
default: "msg",
106-
types: ["msg"],
107-
});
108-
},
10996
});
11097
</script>

src/sacn/sacn-out.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/sacn/sacn-out.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/sacn/scene-controller.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,19 @@
1616
RED.nodes.registerType("scene_controller", {
1717
category: "sACN",
1818
color: "#dcc515",
19-
defaults: {},
19+
defaults: {
20+
name: {
21+
value: "Scene-Controller",
22+
},
23+
},
2024
inputs: 1,
2125
outputs: 1,
2226
paletteLabel: "Scene-Controller",
2327
icon: "bulb.png",
24-
label: () => {
28+
label: function () {
2529
return this.name || "Scene-Controller";
2630
},
27-
labelStyle: () => {
31+
labelStyle: function () {
2832
return this.name ? "node_label_italic" : "";
2933
},
3034
});

ts/sacn/sacn-in.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ const nodeInit: NodeInitializer = (RED): void => {
4343
}
4444
if (config.port !== undefined && config.port > 0) {
4545
options.port = config.port;
46+
} else {
47+
options.port = 5568;
4648
}
4749

4850
// internal functions

ts/sacn/sacn-out.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ const nodeInit: NodeInitializer = (RED): void => {
3838
}
3939
if (config.port !== undefined && config.port > 0) {
4040
options.port = config.port;
41+
} else {
42+
options.port = 5568;
4143
}
4244

4345
const sACN = new Sender(options);

0 commit comments

Comments
 (0)