Skip to content

Commit 9ba6527

Browse files
committed
Apply xo formatting rules
Remove hound
1 parent 8baac5d commit 9ba6527

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3012
-2987
lines changed

.eslintrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.hound.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
'use strict';
1+
'use strict'
22

3-
const SmartApp = require('./lib/smart-app');
3+
const SmartApp = require('./lib/smart-app')
44

55
module.exports = (function (options = {}) {
6-
return new SmartApp(options);
7-
})();
6+
return new SmartApp(options)
7+
})()
88

9-
module.exports.default = Object.assign({}, module.exports);
9+
module.exports.default = Object.assign({}, module.exports)

lib/api.js

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
1-
'use strict';
1+
'use strict'
22

3-
const Client = require('./platform/client');
4-
const Apps = require('./platform/apps');
5-
const DeviceProfiles = require('./platform/deviceprofiles');
6-
const Devices = require('./platform/devices');
7-
const InstalledApps = require('./platform/installedapps');
8-
const Locations = require('./platform/locations');
9-
const Modes = require('./platform/modes');
10-
const Scenes = require('./platform/scenes');
11-
const Schedules = require('./platform/schedules');
12-
const Subscriptions = require('./platform/subscriptions');
3+
const Client = require('./platform/client')
4+
const Apps = require('./platform/apps')
5+
const DeviceProfiles = require('./platform/deviceprofiles')
6+
const Devices = require('./platform/devices')
7+
const InstalledApps = require('./platform/installedapps')
8+
const Locations = require('./platform/locations')
9+
const Modes = require('./platform/modes')
10+
const Scenes = require('./platform/scenes')
11+
const Schedules = require('./platform/schedules')
12+
const Subscriptions = require('./platform/subscriptions')
1313

1414
module.exports = class SmartThingsApi {
15-
16-
constructor(options) {
17-
this.client = new Client(options);
18-
this.apps = new Apps(this);
19-
this.deviceProfiles = new DeviceProfiles(this);
20-
this.devices = new Devices(this);
21-
this.installedApps = new InstalledApps(this);
22-
this.locations = new Locations(this);
23-
this.modes = new Modes(this);
24-
this.scenes = new Scenes(this);
25-
this.schedules = new Schedules(this);
26-
this.subscriptions = new Subscriptions(this);
27-
this.installedAppId = options.installedAppId;
28-
this.locationId = options.locationId;
29-
}
30-
};
15+
constructor(options) {
16+
this.client = new Client(options)
17+
this.apps = new Apps(this)
18+
this.deviceProfiles = new DeviceProfiles(this)
19+
this.devices = new Devices(this)
20+
this.installedApps = new InstalledApps(this)
21+
this.locations = new Locations(this)
22+
this.modes = new Modes(this)
23+
this.scenes = new Scenes(this)
24+
this.schedules = new Schedules(this)
25+
this.subscriptions = new Subscriptions(this)
26+
this.installedAppId = options.installedAppId
27+
this.locationId = options.locationId
28+
}
29+
}

lib/pages/boolean-setting.js

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1-
'use strict';
1+
'use strict'
22

3-
const SectionSetting = require('./section-setting.js');
3+
const SectionSetting = require('./section-setting.js')
44

55
module.exports = class BooleanSetting extends SectionSetting {
6+
constructor(section, id) {
7+
super(section, id)
8+
this._type = 'BOOLEAN'
9+
}
610

7-
constructor(section, id) {
8-
super(section, id);
9-
this._type = 'BOOLEAN';
10-
}
11-
12-
image(value) {
13-
this._image = value;
14-
return this;
15-
}
16-
17-
submitOnChange(value) {
18-
this._submitOnChange = value;
19-
return this;
20-
}
21-
22-
toJson() {
23-
let result = super.toJson();
24-
if (result.defaultValue === undefined && result.required) {
25-
result.defaultValue = 'false';
26-
}
27-
if (this._image) {
28-
result.image = this._image;
29-
}
30-
if (this._submitOnChange) {
31-
result.submitOnChange = this._submitOnChange;
32-
}
33-
return result;
34-
}
35-
};
11+
image(value) {
12+
this._image = value
13+
return this
14+
}
15+
16+
submitOnChange(value) {
17+
this._submitOnChange = value
18+
return this
19+
}
20+
21+
toJson() {
22+
const result = super.toJson()
23+
if (result.defaultValue === undefined && result.required) {
24+
result.defaultValue = 'false'
25+
}
26+
27+
if (this._image) {
28+
result.image = this._image
29+
}
30+
31+
if (this._submitOnChange) {
32+
result.submitOnChange = this._submitOnChange
33+
}
34+
35+
return result
36+
}
37+
}

lib/pages/decimal-setting.js

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,52 @@
1-
'use strict';
1+
'use strict'
22

3-
const SectionSetting = require('./section-setting.js');
3+
const SectionSetting = require('./section-setting.js')
44

55
module.exports = class DecimalSetting extends SectionSetting {
6-
7-
constructor(section, id) {
8-
super(section, id);
9-
this._type = 'DECIMAL';
10-
this._description = 'Tap to set';
11-
}
12-
13-
max(value) {
14-
this._max = value;
15-
return this;
16-
}
17-
18-
min(value) {
19-
this._min = value;
20-
return this;
21-
}
22-
23-
image(value) {
24-
this._image = value;
25-
return this;
26-
}
27-
28-
postMessage(value) {
29-
this._postMessage = value;
30-
return this;
31-
}
32-
33-
toJson() {
34-
let result = super.toJson();
35-
if (this._max) {
36-
result.max = this._max;
37-
}
38-
if (this._min) {
39-
result.min = this._min;
40-
}
41-
if (this._image) {
42-
result.image = this._image;
43-
}
44-
if (this._postMessage) {
45-
result.postMessage = this._postMessage;
46-
}
47-
return result;
48-
}
49-
};
6+
constructor(section, id) {
7+
super(section, id)
8+
this._type = 'DECIMAL'
9+
this._description = 'Tap to set'
10+
}
11+
12+
max(value) {
13+
this._max = value
14+
return this
15+
}
16+
17+
min(value) {
18+
this._min = value
19+
return this
20+
}
21+
22+
image(value) {
23+
this._image = value
24+
return this
25+
}
26+
27+
postMessage(value) {
28+
this._postMessage = value
29+
return this
30+
}
31+
32+
toJson() {
33+
const result = super.toJson()
34+
if (this._max) {
35+
result.max = this._max
36+
}
37+
38+
if (this._min) {
39+
result.min = this._min
40+
}
41+
42+
if (this._image) {
43+
result.image = this._image
44+
}
45+
46+
if (this._postMessage) {
47+
result.postMessage = this._postMessage
48+
}
49+
50+
return result
51+
}
52+
}

0 commit comments

Comments
 (0)