mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
HueNode: Revert API changes
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
-->
|
||||
|
||||
<script type="text/x-red" data-template-name="HueNode">
|
||||
@@ -36,11 +35,6 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-brightness"><i class="icon-tag"></i>Change Brightness (0->100):</label>
|
||||
<input type="text" id="node-input-brightness" placeholder="brightness">
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-color"><i class="icon-tag"></i>Select color:</label>
|
||||
<input type="text" id="node-input-color" placeholder="color">
|
||||
@@ -56,30 +50,29 @@
|
||||
<script type="text/x-red" data-help-name="HueNode">
|
||||
<p>This node implements some basic functionality for managing a Philips Hue wireless Lamp system.</p>
|
||||
<p>To use it you need to have obtained a valid auth token (or username) from your Philips Hue Bridge. Read <a href="http://developers.meethue.com/gettingstarted.html" target="_blank">here</a> on how to do this.</p>
|
||||
<p>You can enter the ID (1, 2, ...) of a Lamp and turn it ON or OFF, set the color and the brightness (0->100). </p><p>By setting the status to AUTO, you can set the ON/OFF status as a message topic (e.g., msg.topic="1:ON", where 1 is the ID of the Lamp) and the color/brightness through the message payload (e.g., msg.payload="DF0101:50" will set the color to red and brightness to 50%) on the node input. Please note, in case you use both, the msg.payload overrides the node configuration through the UI!</p><p>Also, if you pass something like msg.topic="1:ALERT" the Lamp with ID 1 will flash once.</p>
|
||||
<p>You can enter the ID (1, 2, ...) of a Lamp and turn it ON or OFF and also set its color. </p><p>By setting the status to AUTO, you can set the ON/OFF status as a message payload (e.g., msg.payload="ON") and the color through the message topic (e.g., msg.topic="EBF5FF") on the node input. Please note, in case you use both, the status selection overides the msg.payload!</p><p>Also, if you pass something like msg.payload="ALERT" the Lamp will flash once.</p>
|
||||
</script>
|
||||
|
||||
<!-- Finally, the node type is registered along with all of its properties -->
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType('HueNode',{
|
||||
category: 'advanced-input', // the palette category
|
||||
category: 'advanced-input',
|
||||
color:"#EFEFEF",
|
||||
defaults: { // defines the editable properties of the node
|
||||
name: {value:""}, // along with default values.
|
||||
defaults: {
|
||||
name: {value:""},
|
||||
username: {value:"", required:true},
|
||||
discovery_mode: {value: "", required:false},
|
||||
lamp_id: {value:"", required:false},
|
||||
color: {value:"EBF5FF"},
|
||||
brightness: {value:"100"},
|
||||
lamp_status:{}
|
||||
},
|
||||
inputs:1, // set the number of inputs - only 0 or 1
|
||||
outputs:1, // set the number of outputs - 0 to n
|
||||
icon: "huemanage.png", // set the icon (held in public/icons)
|
||||
label: function() { // sets the default label contents
|
||||
return this.name||this.topic||"HueNode";
|
||||
inputs:1,
|
||||
outputs:1,
|
||||
icon: "hue.png",
|
||||
label: function() {
|
||||
return this.name||"HueNode";
|
||||
},
|
||||
labelStyle: function() { // sets the class to apply to the label
|
||||
labelStyle: function() {
|
||||
return this.name?"node_label_italic":"";
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user