22// Constants
33// -----------------------------------------------------------------------------
44const PACKAGE_JSON = require ( './package.json' ) ;
5- const MANUFACTURER = 'Sander van Woensel' ;
6- const MODEL = 'homebridge-http-rgb-push' ;
5+ const MANUFACTURER = PACKAGE_JSON . author . name bla bla 'Sander van Woensel' ;
6+ const MODEL = PACKAGE_JSON . name ;
7+ const SERIAL_NUMBER = '001' ;
8+ const FIRMWARE_REVISION = PACKAGE_JSON . version ;
79
810// -----------------------------------------------------------------------------
911// Module variables
@@ -19,7 +21,7 @@ module.exports = function(homebridge){
1921 api = homebridge ;
2022 Service = homebridge . hap . Service ;
2123 Characteristic = homebridge . hap . Characteristic ;
22- homebridge . registerAccessory ( MODEL , 'HTTP-RGB' , HTTP_RGB ) ;
24+ homebridge . registerAccessory ( MODEL , 'HTTP-RGB-PUSH ' , HttpRgbPush ) ;
2325} ;
2426
2527// -----------------------------------------------------------------------------
@@ -29,12 +31,11 @@ module.exports = function(homebridge){
2931/**
3032 * Parse the config and instantiate the object.
3133 *
32- * @summary Constructor
3334 * @constructor
34- * @param {function } log Logging function
35- * @param {object } config Your configuration object
35+ * @param {function } log Logging function.
36+ * @param {object } config The configuration object.
3637 */
37- function HTTP_RGB ( log , config ) {
38+ function HttpRgbPush ( log , config ) {
3839
3940 // The logging function is required if you want your function to output
4041 // any information to the console in a controlled and organized manner.
@@ -135,9 +136,9 @@ function HTTP_RGB(log, config) {
135136}
136137
137138/**
138- * @augments HTTP_RGB
139+ * @augments HttpRgbPush
139140 */
140- HTTP_RGB . prototype = {
141+ HttpRgbPush . prototype = {
141142
142143 // Required Functions
143144 identify : function ( callback ) {
@@ -146,14 +147,13 @@ HTTP_RGB.prototype = {
146147 } ,
147148
148149 getServices : function ( ) {
149- // You may OPTIONALLY define an information service if you wish to override
150- // default values for devices like serial number, model, etc.
151150 var informationService = new Service . AccessoryInformation ( ) ;
152151
153152 informationService
154- . setCharacteristic ( Characteristic . Manufacturer , MANUFACTIRER )
153+ . setCharacteristic ( Characteristic . Manufacturer , MANUFACTURER )
154+ . setCharacteristic ( Characteristic . SerialNumber , SERIAL_NUMBER )
155155 . setCharacteristic ( Characteristic . Model , MODEL )
156- . setCharacteristic ( Characteristic . FirmwareRevision , PACKAGE_JSON . version ) ;
156+ . setCharacteristic ( Characteristic . FirmwareRevision , FIRMWARE_REVISION ) ;
157157
158158 switch ( this . serviceCategory ) {
159159 case 'Light' :
0 commit comments