node-red-contrib-grove-base-hat-dtam
Version:
The node for Grove Base HAT for Raspberry Pi with extensions for the DTAM project.
48 lines (44 loc) • 1.65 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('grove-relay',{
category: 'grove-base-hat',
color: '#a6bbcf',
defaults: {
name: {value:""},
port_number: {value:5}
},
inputs:1,
outputs:0,
icon: "light.png",
label: function() {
return this.name||"grove-relay";
}
});
</script>
<script type="text/x-red" data-template-name="grove-relay">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Port</label>
<select style="width:90px; margin-left:20px;" id="node-input-port_number" value="5">
<option value="5">D5</option>
<option value="16">D16</option>
<option value="18">D18</option>
<option value="22">D22</option>
<option value="24">D24</option>
<option value="26">D26</option>
</select>
</div>
<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>
<script type="text/x-red" data-help-name="grove-relay">
<p>The node controls Grove Relay.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>payload
<span class="property-type">number</span>
</dt>
<dd> the payload of the message to publish.</dd>
<h3>Details</h3>
<p>This node controls Grove Relay. When the payload is 1, The node turn on it. When the payload is 0, The node turn off it.</p>
</script>