UNPKG

node-red-contrib-yeelight-compat-hue

Version:

A collection of Node-RED nodes for controlling and observing Yeelight lighting devices, compatible with node-red-contrib-node-hue flows.

77 lines (71 loc) 2.51 kB
<script type="text/javascript"> RED.nodes.registerType('yeelight-compat-hue-out', { category: 'lights', color: '#E2D96E', defaults: { name: { value: '' }, server: { value: '', required: true, type: 'yeelight-compat-hue-config' }, }, inputs: 1, outputs: 0, icon: 'light.png', label: function() { var server = RED.nodes.node(this.server); return this.name || server ? server.label().replace(/\s\(.+\)/, '') : 'yeelight'; }, paletteLabel: 'yeelight', align: 'right', }); </script> <script type="text/x-red" data-template-name="yeelight-compat-hue-out"> <div class="form-row"> <label for="node-input-server"><i class="icon-tag"></i> Yeelight</label> <input type="text" id="node-input-server" /> </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="yeelight-compat-hue-out"> <p>Sets the state of the selected Yeelight device, largely <a href="https://github.com/jdomeij/node-red-contrib-node-hue#readme">compatible with node-red-contrib-node-hue</a>.</p> <h3>Inputs</h3> <dl class="message-properties"> <dt>payload <span class="property-type">object</span></dt> <dd>an object containing the next state of the selected Yeelight device.</dd> </dl> <h3>Details</h3> <p>The node supports sending hex values, HSV values and color temperature values.</p> <p>The brightness value will always have to be provided separately and will not be deducted from e.g. a hex value's brightness component.</p> <h4>Example inputs</h4> <p> <pre><code>{ "on": true, "bri": 255, "hue": 913, "sat": 255, "duration": 5000 }</code></pre> <pre><code>{ "on": true, "bri": 120, "hex": "#AA00CC" }</code></pre> <pre><code>{ "on": true, "ct": 2200 }</code></pre> </p> <h3>References</h3> <p>This node's input is based on <a href="https://github.com/jdomeij/node-red-contrib-node-hue#readme">node-red-contrib-node-hue</a>, which is based on <a href="https://github.com/peter-murray/node-hue-api#lightstate-options">Node Hue API</a>.</p> </script>