UNPKG

node-red-contrib-susi

Version:
64 lines (53 loc) 2.58 kB
<!-- Copyright 2014, 2015 ADVANTECH Corp. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- Define the edit dialog. --> <script type="text/x-red" data-template-name="SUSIIoT-Control"> <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"> </div> <br/> <!-- Node name --> <div class="form-row"> <label for="node-input-name"><i class="icon-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> </script> <!-- Next, some simple help text is provided for the node. --> <script type="text/x-red" data-help-name="SUSIIoT-Control"> <p>Node to retrieve the status of a ADVANTECH platform by SUSIIoT, either at startup, or at a predefined period, determined by an input message</p> <p>Outputs a <b>msg</b> containing <b>msg.topic</b> which defaults to the sensor name, and <b>msg.payload</b> containing the reading.</p> </script> <script type="text/javascript"> RED.nodes.registerType('SUSIIoT-Control', { category: 'ADVANTECH', // the palette category defaults: { // defines the editable properties of the node name: {value: ""}, topic: {value: "SUSIIoT Control"}, }, inputs: 1, // set the number of inputs - only 0 or 1 outputs: 1, // set the number of outputs - 0 to n color: "#FFAAAA", icon: "white-globe.png", // saved in icons/myicon.png align: "right", paletteLabel: "IoT Control", label: function() { // sets the default label contents return this.name||this.topic||"SUSIIoT-Control"; }, labelStyle: function() { // sets the class to apply to the label return this.name ? "node_label_italic": ""; }, }); </script>