Skip to content

Commit ee40516

Browse files
author
QuickSander
committed
fix(): Typo in information service
1 parent c18914b commit ee40516

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

index.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
// Constants
33
// -----------------------------------------------------------------------------
44
const 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':

test/basics.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('Homebridge plugin creation', function () {
5555
expect(spy.getCall(0).args[0]).
5656
equal('homebridge-http-rgb-push');
5757
expect(spy.getCall(0).args[1]).
58-
equal('HTTP-RGB');
58+
equal('HTTP-RGB-PUSH');
5959
});
6060

6161
it('constructor registers to didFinishLaunching event', function () {

0 commit comments

Comments
 (0)