UNPKG

node-red-contrib-nefit-easy

Version:
105 lines (94 loc) 4.83 kB
<!-- Nefit Easy Node for Node-RED ------------------------------------------------------------------------------------------------------------------- Copyright (c) 2016 Pepijn Goossens Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --> <script type="text/x-red" data-template-name="nefit-easy"> <div class="form-row"> <label for="node-input-easyconfig"><i class="fa fa-globe"></i> Nefit Easy</label> <input type="text" id="node-input-easyconfig"> </div> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> <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> <div class="form-row"> <label for="node-input-command"><i class="fa fa-cogs"></i> Command</label> <select type="text" id="node-input-command" style="width: 150px;"> <option value="status">Status</option> <option value="pressure">Pressure</option> <option value="location">Location</option> <option value="program">Program data</option> <option value="display-code">Display boiler statuscode</option> <option value="flow-temperature">Flow temperature</option> <option value="set-temperature">Set temperature</option> </select> </div> </script> <script type="text/x-red" data-help-name="nefit-easy"> <p>This node uses the Nefit Easy Client Library to connect to your Nefit Easy thermostat.</p> </script> <script type="text/javascript"> RED.nodes.registerType('nefit-easy',{ category: 'function', color:"#999999", defaults: { easyconfig: {value:"", type:"nefit-easy-config"}, name: {value:""}, topic: {value:"nefit-easy", required:true}, command: {value:""} }, inputs:1, outputs:1, icon: "nefit_easy_icon.png", // saved in icons/myicon.png label: function() { // sets the default label contents return this.name||this.topic||"Nefit Easy"; }, paletteLabel: "nefit easy", labelStyle: function() { // sets the class to apply to the label return this.name?"node_label_italic":""; } }); </script> <!-- Configuration node for Easy connection settings. --> <script type="text/javascript"> RED.nodes.registerType('nefit-easy-config',{ category: 'config', defaults: { serialNumber: {value:""}, accessKey: {value:""}, password: {value:""}, timeout: {value:"30"} }, label: function() { return "Easy - "+this.serialNumber; } }); </script> <script type="text/x-red" data-template-name="nefit-easy-config"> <div class="form-row"> <label for="node-config-input-serialNumber"><i class="fa fa-asterisk"></i> Serial</label> <input type="text" id="node-config-input-serialNumber" placeholder="Nefit Easy Serial"> </div> <div class="form-row"> <label for="node-config-input-accessKey"><i class="fa fa-tablet"></i> Accesscode</label> <input type="text" id="node-config-input-accessKey" placeholder="Nefit Easy Access Code"> </div> <div class="form-row"> <label for="node-config-input-password"><i class="fa fa-lock"></i> Password</label> <input type="password" id="node-config-input-password"> </div> <div class="form-row"> <label for="node-config-input-timeout"><i class="fa fa-cogs"></i> Timeout</label> <input type="text" id="node-config-input-timeout"> </div> </script>