UNPKG

node-red-contrib-switchbot-devices

Version:

Simple node to get list of Switchbot devices and their status with Node-RED

32 lines (30 loc) 1.03 kB
<script type="text/javascript"> RED.nodes.registerType('switchbot-status', { category: 'Switchbot', color: '#CE4842', defaults: { acc: {value: '', type: 'switchbot-token'}, name: { value: "" } }, inputs: 1, outputs: 1, icon: "switchbot.png", label: function () { return this.name || "status"; }, paletteLabel: 'device status' }); </script> <script type="text/html" data-template-name="switchbot-status"> <div class="form-row"> <label for="node-input-acc"><i class="fa fa-vcard"></i> User</label> <input type="text" id="node-input-acc" placeholder="Switchbot Account"> </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> </script> <script type="text/html" data-help-name="switchbot-status"> <p>Inject this node with a specific Switchbot device ID then it will output status of the device</p> </script>