node-red-contrib-meross
Version:
This provides nodes for controlling Meross devices.
40 lines (37 loc) • 1.31 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('smartplug-control',{
category: 'Meross',
defaults: {
confignode: { value: '', type: 'meross-config' },
name: { value: '' },
ip: { value: '', type: 'text', required: true }
},
inputs: 1, // set the number of inputs - only 0 or 1
outputs: 1, // set the number of outputs - 0 to n
icon: 'smartplug.png', // saved in icons/myicon.png
color: '#005AFF',
label: function() {
return this.name || 'Smart Plug';
},
paletteLabel: 'Smart Plug'
});
</script>
<!-- Setting design and inputs for node -->
<script type="text/x-red" data-template-name="smartplug-control">
<div class="form-row">
<label for="node-input-confignode"> Meross</label>
<input type="text" id="node-input-confignode">
</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="Meross Smart Plug Node Name">
</div>
<div class="form-row">
<label for="node-input-ip"><i class="fa fa-tag"></i> IP</label>
<input type="text" id="node-input-ip" placeholder="IP address of your Smart Plug">
</div>
</script>
<!-- Simple Help Text -->
<script type="text/x-red" data-help-name="evohome-control">
<p>A node to control Meross Smart Plug.</p>
</script>