Reorganise/de-duplicate Philips Hue node

This commit is contained in:
Dave C-J
2014-01-12 12:06:13 +00:00
parent f61b8ae034
commit 4cd6be3cde
9 changed files with 62 additions and 465 deletions

View File

@@ -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">
@@ -57,23 +56,23 @@
<!-- 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"},
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":"";
}
});