@smappee/node-red-contrib-smappee-solar
Version:
45 lines (40 loc) • 1.46 kB
HTML
<script type="text/x-red" data-template-name="solaredge-site-config">
<div class="form-row">
<label for="node-config-input-siteId"><i class="fa fa-tag"></i> <span>Site ID</span></label>
<input type="text" id="node-config-input-siteId">
</div>
<div class="form-row">
<label for="node-config-input-apiKey"><i class="fa fa-key"></i> <span>API key</span></label>
<input type="text" id="node-config-input-apiKey">
</div>
<div class="form-row">
<label for="node-config-input-name"><i class="fa fa-tag"></i> <span>Name</span></label>
<input type="text" id="node-config-input-name" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="solaredge-site-config">
<p>A configuration node for a SolarEdge site.</p>
<h3>Properties</h3>
<h4>Site ID</h4>
<p>Site identifier, typically a numeric ID.</p>
<h4>API key</h4>
<p>SolarEdge key for the API.</p>
<h4>Name</h4>
<p>Type in a node name manually or keep the default name.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('solaredge-site-config', {
category: 'config',
defaults: {
name: {value: ''},
siteId: {value: '', required: true},
apiKey: {value: '', required: true},
},
label: function() {
return this.name || 'site' + (this.siteId ? `:${this.siteId}` : '');
},
labelStyle: function() {
return this.name ? 'node_label_italic' : '';
},
});
</script>