This commit is contained in:
2018-12-20 22:06:06 +08:00
parent 6b4ec16652
commit 7f92cd3156
14 changed files with 94 additions and 93 deletions
+33 -33
View File
@@ -14,7 +14,7 @@
limitations under the License.
-->
<script type="text/x-red" data-template-name="ioBroker in">
<script type="text/x-red" data-template-name="yunkong2 in">
<div class="form-row">
<label for="node-input-topic"><i class="fa fa-tasks"></i> Topic</label>
<input type="text" id="node-input-topic" placeholder="Topic" style="width:60%"><input type="button" id="node-input-topic-button" style="display:inline-block;width:10%" value="."/>
@@ -50,8 +50,8 @@
</div>
</script>
<script type="text/x-red" data-help-name="ioBroker in">
<p>ioBroker input node. Connects to a ioBroker and subscribes to the specified topic. The topic may contain redis wildcards (*).</p>
<script type="text/x-red" data-help-name="yunkong2 in">
<p>yunkong2 input node. Connects to a yunkong2 and subscribes to the specified topic. The topic may contain redis wildcards (*).</p>
<p>Outputs an object called <b>msg</b> containing <b>msg.topic, msg.payload, msg.timestamp, msg.lastchange and msg.acknowledged.</p>
<p>The checkbox determines whether only States with ack == true or all events are forwarded.</p>
<p>The select box Mode offers further filtering options. The options are the same as for the RBE node.</p>
@@ -70,7 +70,7 @@
<script type="text/javascript">
RED.nodes.registerType('ioBroker in',{
RED.nodes.registerType('yunkong2 in',{
category: 'input',
defaults: {
name: {value:""},
@@ -84,19 +84,19 @@
color:"#a8bfd8",
inputs:0,
outputs:1,
icon: "ioBroker.png",
icon: "yunkong2.png",
label: function() {
return this.name||this.topic||"ioBroker";
return this.name||this.topic||"yunkong2";
},
labelStyle: function() {
return this.name?"node_label_italic":"";
},
oneditprepare: function() {
if (!window.__iobroker) {
$.getJSON("iobroker.json", function(data) {
window.__iobroker = data;
if (!window.__yunkong2) {
$.getJSON("yunkong2.json", function(data) {
window.__yunkong2 = data;
$('#dialog-select-member').selectId('init', {
objects: window.__iobroker,
objects: window.__yunkong2,
noMultiselect: true,
columns: ['name', 'role', 'enum', 'room'],
states: null,
@@ -105,7 +105,7 @@
});
} else {
$('#dialog-select-member').selectId('init', {
objects: window.__iobroker,
objects: window.__yunkong2,
noMultiselect: true,
columns: ['name', 'role', 'enum', 'room'],
states: null,
@@ -142,7 +142,7 @@
});
</script>
<script type="text/x-red" data-template-name="ioBroker out">
<script type="text/x-red" data-template-name="yunkong2 out">
<div class="form-row">
<label for="node-input-topic"><i class="fa fa-tasks"></i> Topic</label>
<input type="text" id="node-input-topic" placeholder="Topic" style="width:60%"><input type="button" id="node-input-topic-button" style="display:inline-block;width:10%" value="."/>
@@ -169,14 +169,14 @@
<div class="form-tips">Tip: Leave topic blank if you want to set them via msg properties.</div>
</script>
<script type="text/x-red" data-help-name="ioBroker out">
<p>Connects to a ioBroker and publishes <b>msg.payload</b> either to the <b>msg.topic</b> or to the topic specified in the edit window. The value in the edit window has precedence.</p>
<script type="text/x-red" data-help-name="yunkong2 out">
<p>Connects to a yunkong2 and publishes <b>msg.payload</b> either to the <b>msg.topic</b> or to the topic specified in the edit window. The value in the edit window has precedence.</p>
<p>If <b>msg.payload</b> contains an object it will be stringified before being sent.</p>
<p>If <b>msg.payload</b> contains "__create__", the object will be only created, but no value will be written.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('ioBroker out',{
RED.nodes.registerType('yunkong2 out',{
category: 'output',
defaults: {
name: {value:""},
@@ -187,20 +187,20 @@ RED.nodes.registerType('ioBroker out',{
color:"#a8bfd8",
inputs:1,
outputs:0,
icon: "ioBroker.png",
icon: "yunkong2.png",
align: "right",
label: function() {
return this.name||this.topic||"ioBroker";
return this.name||this.topic||"yunkong2";
},
labelStyle: function() {
return this.name?"node_label_italic":"";
},
oneditprepare: function() {
if (!window.__iobroker) {
$.getJSON("iobroker.json", function(data) {
window.__iobroker = data;
if (!window.__yunkong2) {
$.getJSON("yunkong2.json", function(data) {
window.__yunkong2 = data;
$('#dialog-select-member').selectId('init', {
objects: window.__iobroker,
objects: window.__yunkong2,
noMultiselect: true,
columns: ['name', 'role', 'enum', 'room'],
states: null,
@@ -209,7 +209,7 @@ RED.nodes.registerType('ioBroker out',{
});
} else {
$('#dialog-select-member').selectId('init', {
objects: window.__iobroker,
objects: window.__yunkong2,
noMultiselect: true,
columns: ['name', 'role', 'enum', 'room'],
states: null,
@@ -236,7 +236,7 @@ RED.nodes.registerType('ioBroker out',{
});
</script>
<script type="text/x-red" data-template-name="ioBroker get">
<script type="text/x-red" data-template-name="yunkong2 get">
<div class="form-row">
<label for="node-input-topic"><i class="fa fa-tasks"></i> Topic</label>
<input type="text" id="node-input-topic" placeholder="Topic" style="width:60%"><input type="button" id="node-input-topic-button" style="display:inline-block;width:10%" value="."/>
@@ -260,14 +260,14 @@ RED.nodes.registerType('ioBroker out',{
<div class="form-tips">Tip: Leave topic blank if you want to set them via msg properties.</div>
</script>
<script type="text/x-red" data-help-name="ioBroker get">
<p>Connects to a ioBroker and returns the requested value or the object in the massage attribute in the properties dialog, e.g. <b>msg.payload</b>. The object could be identified either by the <b>msg.topic</b> or specified in the poperties dialog. The value in the poperties dialog has precedence.</p>
<script type="text/x-red" data-help-name="yunkong2 get">
<p>Connects to a yunkong2 and returns the requested value or the object in the massage attribute in the properties dialog, e.g. <b>msg.payload</b>. The object could be identified either by the <b>msg.topic</b> or specified in the poperties dialog. The value in the poperties dialog has precedence.</p>
<p>The msg object also contains the attributs <b>msg.timestamp</b>, <b>msg.lastchange</b> and <b>msg.acknowledged</b>. All other attributes ob the input msg object will be passed to the output msg object.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('ioBroker get',{
RED.nodes.registerType('yunkong2 get',{
category: 'function',
defaults: {
name: {value:""},
@@ -278,19 +278,19 @@ RED.nodes.registerType('ioBroker get',{
color:"#a8bfd8",
inputs:1,
outputs:1,
icon: "ioBroker.png",
icon: "yunkong2.png",
label: function() {
return this.name||this.topic||"ioBroker get";
return this.name||this.topic||"yunkong2 get";
},
labelStyle: function() {
return this.name?"node_label_italic":"";
},
oneditprepare: function() {
if (!window.__iobroker) {
$.getJSON("iobroker.json", function(data) {
window.__iobroker = data;
if (!window.__yunkong2) {
$.getJSON("yunkong2.json", function(data) {
window.__yunkong2 = data;
$('#dialog-select-member').selectId('init', {
objects: window.__iobroker,
objects: window.__yunkong2,
noMultiselect: true,
columns: ['name', 'role', 'enum', 'room'],
states: null,
@@ -299,7 +299,7 @@ RED.nodes.registerType('ioBroker get',{
});
} else {
$('#dialog-select-member').selectId('init', {
objects: window.__iobroker,
objects: window.__yunkong2,
noMultiselect: true,
columns: ['name', 'role', 'enum', 'room'],
states: null,