mirror of
https://github.com/mtan93/homebridge.git
synced 2026-05-11 14:26:05 +01:00
Clean up some really odd spacing and add SN
This commit is contained in:
+121
-105
@@ -159,112 +159,128 @@ PhilipsHueAccessory.prototype = {
|
|||||||
// Get Services
|
// Get Services
|
||||||
getServices: function() {
|
getServices: function() {
|
||||||
var that = this;
|
var that = this;
|
||||||
return [{
|
return [
|
||||||
sType: types.ACCESSORY_INFORMATION_STYPE,
|
{
|
||||||
characteristics: [{
|
sType: types.ACCESSORY_INFORMATION_STYPE,
|
||||||
cType: types.NAME_CTYPE,
|
characteristics: [
|
||||||
onUpdate: null,
|
{
|
||||||
perms: ["pr"],
|
cType: types.NAME_CTYPE,
|
||||||
format: "string",
|
onUpdate: null,
|
||||||
initialValue: this.name,
|
perms: ["pr"],
|
||||||
supportEvents: false,
|
format: "string",
|
||||||
supportBonjour: false,
|
initialValue: this.name,
|
||||||
manfDescription: "Name of the accessory",
|
supportEvents: false,
|
||||||
designedMaxLength: 255
|
supportBonjour: false,
|
||||||
|
manfDescription: "Name of the accessory",
|
||||||
|
designedMaxLength: 255
|
||||||
|
},{
|
||||||
|
cType: types.MANUFACTURER_CTYPE,
|
||||||
|
onUpdate: null,
|
||||||
|
perms: ["pr"],
|
||||||
|
format: "string",
|
||||||
|
initialValue: "Philips",
|
||||||
|
supportEvents: false,
|
||||||
|
supportBonjour: false,
|
||||||
|
manfDescription: "Manufacturer",
|
||||||
|
designedMaxLength: 255
|
||||||
|
},{
|
||||||
|
cType: types.MODEL_CTYPE,
|
||||||
|
onUpdate: null,
|
||||||
|
perms: ["pr"],
|
||||||
|
format: "string",
|
||||||
|
initialValue: this.model,
|
||||||
|
supportEvents: false,
|
||||||
|
supportBonjour: false,
|
||||||
|
manfDescription: "Model",
|
||||||
|
designedMaxLength: 255
|
||||||
|
},{
|
||||||
|
cType: types.SERIAL_NUMBER_CTYPE,
|
||||||
|
onUpdate: null,
|
||||||
|
perms: ["pr"],
|
||||||
|
format: "string",
|
||||||
|
initialValue: this.model + this.id,
|
||||||
|
supportEvents: false,
|
||||||
|
supportBonjour: false,
|
||||||
|
manfDescription: "SN",
|
||||||
|
designedMaxLength: 255
|
||||||
|
},{
|
||||||
|
cType: types.IDENTIFY_CTYPE,
|
||||||
|
onUpdate: function(value) { console.log("Change:",value); execute(this.device, this.id, "identify", value); },
|
||||||
|
perms: ["pw"],
|
||||||
|
format: "bool",
|
||||||
|
initialValue: false,
|
||||||
|
supportEvents: false,
|
||||||
|
supportBonjour: false,
|
||||||
|
manfDescription: "Identify Accessory",
|
||||||
|
designedMaxLength: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
},{
|
},{
|
||||||
cType: types.MANUFACTURER_CTYPE,
|
sType: types.LIGHTBULB_STYPE,
|
||||||
onUpdate: null,
|
characteristics: [
|
||||||
perms: ["pr"],
|
{
|
||||||
format: "string",
|
cType: types.NAME_CTYPE,
|
||||||
initialValue: "Philips",
|
onUpdate: null,
|
||||||
supportEvents: false,
|
perms: ["pr"],
|
||||||
supportBonjour: false,
|
format: "string",
|
||||||
manfDescription: "Manufacturer",
|
initialValue: this.name,
|
||||||
designedMaxLength: 255
|
supportEvents: false,
|
||||||
},{
|
supportBonjour: false,
|
||||||
cType: types.MODEL_CTYPE,
|
manfDescription: "Name of service",
|
||||||
onUpdate: null,
|
designedMaxLength: 255
|
||||||
perms: ["pr"],
|
},{
|
||||||
format: "string",
|
cType: types.POWER_STATE_CTYPE,
|
||||||
initialValue: this.model,
|
onUpdate: function(value) { console.log("Change:",value); execute(this.api, this.device, "on", value); },
|
||||||
supportEvents: false,
|
perms: ["pw","pr","ev"],
|
||||||
supportBonjour: false,
|
format: "bool",
|
||||||
manfDescription: "Model",
|
initialValue: false,
|
||||||
designedMaxLength: 255
|
supportEvents: false,
|
||||||
},{
|
supportBonjour: false,
|
||||||
cType: types.IDENTIFY_CTYPE,
|
manfDescription: "Turn On the Light",
|
||||||
onUpdate: function(value) { console.log("Change:",value); execute(this.device, this.id, "identify", value); },
|
designedMaxLength: 1
|
||||||
perms: ["pw"],
|
},{
|
||||||
format: "bool",
|
cType: types.HUE_CTYPE,
|
||||||
initialValue: false,
|
onUpdate: function(value) { console.log("Change:",value); execute(this.api, this.device, "hue", value); },
|
||||||
supportEvents: false,
|
perms: ["pw","pr","ev"],
|
||||||
supportBonjour: false,
|
format: "int",
|
||||||
manfDescription: "Identify Accessory",
|
initialValue: 0,
|
||||||
designedMaxLength: 1
|
supportEvents: false,
|
||||||
}]
|
supportBonjour: false,
|
||||||
},{
|
manfDescription: "Adjust Hue of Light",
|
||||||
sType: types.LIGHTBULB_STYPE,
|
designedMinValue: 0,
|
||||||
characteristics: [{
|
designedMaxValue: 65535,
|
||||||
cType: types.NAME_CTYPE,
|
designedMinStep: 1,
|
||||||
onUpdate: null,
|
unit: "arcdegrees"
|
||||||
perms: ["pr"],
|
},{
|
||||||
format: "string",
|
cType: types.BRIGHTNESS_CTYPE,
|
||||||
initialValue: this.name,
|
onUpdate: function(value) { console.log("Change:",value); execute(this.api, this.device, "brightness", value); },
|
||||||
supportEvents: false,
|
perms: ["pw","pr","ev"],
|
||||||
supportBonjour: false,
|
format: "int",
|
||||||
manfDescription: "Name of service",
|
initialValue: 0,
|
||||||
designedMaxLength: 255
|
supportEvents: false,
|
||||||
},{
|
supportBonjour: false,
|
||||||
cType: types.POWER_STATE_CTYPE,
|
manfDescription: "Adjust Brightness of Light",
|
||||||
onUpdate: function(value) { console.log("Change:",value); execute(this.api, this.device, "on", value); },
|
designedMinValue: 0,
|
||||||
perms: ["pw","pr","ev"],
|
designedMaxValue: 100,
|
||||||
format: "bool",
|
designedMinStep: 1,
|
||||||
initialValue: false,
|
unit: "%"
|
||||||
supportEvents: false,
|
},{
|
||||||
supportBonjour: false,
|
cType: types.SATURATION_CTYPE,
|
||||||
manfDescription: "Turn On the Light",
|
onUpdate: function(value) { console.log("Change:",value); execute(this.api, this.device, "saturation", value); },
|
||||||
designedMaxLength: 1
|
perms: ["pw","pr","ev"],
|
||||||
},{
|
format: "int",
|
||||||
cType: types.HUE_CTYPE,
|
initialValue: 0,
|
||||||
onUpdate: function(value) { console.log("Change:",value); execute(this.api, this.device, "hue", value); },
|
supportEvents: false,
|
||||||
perms: ["pw","pr","ev"],
|
supportBonjour: false,
|
||||||
format: "int",
|
manfDescription: "Adjust Saturation of Light",
|
||||||
initialValue: 0,
|
designedMinValue: 0,
|
||||||
supportEvents: false,
|
designedMaxValue: 100,
|
||||||
supportBonjour: false,
|
designedMinStep: 1,
|
||||||
manfDescription: "Adjust Hue of Light",
|
unit: "%"
|
||||||
designedMinValue: 0,
|
}
|
||||||
designedMaxValue: 65535,
|
]
|
||||||
designedMinStep: 1,
|
}
|
||||||
unit: "arcdegrees"
|
];
|
||||||
},{
|
|
||||||
cType: types.BRIGHTNESS_CTYPE,
|
|
||||||
onUpdate: function(value) { console.log("Change:",value); execute(this.api, this.device, "brightness", value); },
|
|
||||||
perms: ["pw","pr","ev"],
|
|
||||||
format: "int",
|
|
||||||
initialValue: 0,
|
|
||||||
supportEvents: false,
|
|
||||||
supportBonjour: false,
|
|
||||||
manfDescription: "Adjust Brightness of Light",
|
|
||||||
designedMinValue: 0,
|
|
||||||
designedMaxValue: 100,
|
|
||||||
designedMinStep: 1,
|
|
||||||
unit: "%"
|
|
||||||
},{
|
|
||||||
cType: types.SATURATION_CTYPE,
|
|
||||||
onUpdate: function(value) { console.log("Change:",value); execute(this.api, this.device, "saturation", value); },
|
|
||||||
perms: ["pw","pr","ev"],
|
|
||||||
format: "int",
|
|
||||||
initialValue: 0,
|
|
||||||
supportEvents: false,
|
|
||||||
supportBonjour: false,
|
|
||||||
manfDescription: "Adjust Saturation of Light",
|
|
||||||
designedMinValue: 0,
|
|
||||||
designedMaxValue: 100,
|
|
||||||
designedMinStep: 1,
|
|
||||||
unit: "%"
|
|
||||||
}]
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user