Skip to content

Commit 7455c19

Browse files
author
QuickSander
committed
chore: Remame all capital accessory name to camelCase
1 parent 482cc78 commit 7455c19

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ sudo npm uninstall -g homebridge-http-rgb-push
4848

4949
"accessories": [
5050
{
51-
"accessory": "HTTP-RGB-PUSH",
51+
"accessory": "HttpPushRgb",
5252
"name": "RGB Led Strip",
5353
"service": "Light",
5454
"timeout": 3000,
@@ -76,7 +76,7 @@ sudo npm uninstall -g homebridge-http-rgb-push
7676

7777
"accessories": [
7878
{
79-
"accessory": "HTTP-RGB-PUSH",
79+
"accessory": "HttpPushRgb",
8080
"name": "Single Color Light",
8181
"service": "Light",
8282

@@ -92,7 +92,7 @@ sudo npm uninstall -g homebridge-http-rgb-push
9292

9393
"accessories": [
9494
{
95-
"accessory": "HTTP-RGB-PUSH",
95+
"accessory": "HttpPushRgb",
9696
"name": "Single Color Light",
9797
"service": "Light",
9898

@@ -113,7 +113,7 @@ sudo npm uninstall -g homebridge-http-rgb-push
113113

114114
"accessories": [
115115
{
116-
"accessory": "HTTP-RGB-PUSH",
116+
"accessory": "HttpPushRgb",
117117
"name": "Single Color Light",
118118
"service": "Light",
119119

@@ -138,7 +138,7 @@ remove the brightness component from the config.
138138

139139
"accessories": [
140140
{
141-
"accessory": "HTTP-RGB-PUSH",
141+
"accessory": "HttpPushRgb",
142142
"name": "JSON body matching",
143143
"service": "Light",
144144

@@ -158,7 +158,7 @@ remove the brightness component from the config.
158158

159159
| Key | Description | Default |
160160
| --- | --- | --- |
161-
| `accessory` | Must be "HTTP-RGB-PUSH" | |
161+
| `accessory` | Must be "HttpPushRgb" | |
162162
| `name` | The name of your RGB accessory. It will appear in the Home app | "RGB Light" |
163163
| `service` | `"Light"` or `"Switch"` | |
164164
| `timeout` _(optional)_ | Time (in milli seconds) until the accessory will be marked as "Not Responding" if it is unreachable.| 5000 |

index.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// ISC License - Copyright 2018, Sander van Woensel
22
// TODO: colorsys usage?
3-
// get rid of all capitals accessory name.
43
// enable coverage measurement.
54

65
// -----------------------------------------------------------------------------
@@ -26,7 +25,7 @@ module.exports = function(homebridge){
2625
api = homebridge;
2726
Service = homebridge.hap.Service;
2827
Characteristic = homebridge.hap.Characteristic;
29-
homebridge.registerAccessory(MODEL, 'HTTP-RGB-PUSH', HttpRgbPush);
28+
homebridge.registerAccessory(MODEL, 'HttpPushRgb', HttpPushRgb);
3029
};
3130

3231
// -----------------------------------------------------------------------------
@@ -40,10 +39,8 @@ module.exports = function(homebridge){
4039
* @param {function} log Logging function.
4140
* @param {object} config The configuration object.
4241
*/
43-
function HttpRgbPush(log, config) {
42+
function HttpPushRgb(log, config) {
4443

45-
// The logging function is required if you want your function to output
46-
// any information to the console in a controlled and organized manner.
4744
this.log = log;
4845

4946
this.service = null;
@@ -141,9 +138,9 @@ function HttpRgbPush(log, config) {
141138
}
142139

143140
/**
144-
* @augments HttpRgbPush
141+
* @augments HttpPushRgb
145142
*/
146-
HttpRgbPush.prototype = {
143+
HttpPushRgb.prototype = {
147144

148145
// Required Functions
149146
identify: function(callback) {

test/basics.test.js

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

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

0 commit comments

Comments
 (0)